sql server inner join convert collation 1

sql server inner join convert collation

SELECT *
  FROM [FAEB].[dbo].[ExportaComisiones] AS f
  JOIN [zCredifiel].[dbo].[optPerson] AS p

  ON p.vTreasuryId COLLATE Latin1_General_CI_AS = f.RFC COLLATE Latin1_General_CI_AS 

Here is what the above code is Doing:
1. It’s creating a new dataframe called df_comisiones_credifiel.
2. It’s using the pandas read_sql_query function to read the data from the SQL query.
3. It’s using the pandas to_sql function to write the data to the SQL table.

The code is pretty straightforward. The only thing that might be confusing is the SQL query.

The SQL query is doing the following:
1. It’s selecting all the columns from the ExportaComisiones table.
2. It’s joining the ExportaComisiones table with the optPerson table.
3. It’s joining the tables on the RFC column.

The SQL query is pretty straightforward. The only thing that might be confusing is the COLLATE Latin1_General_CI_AS.

The COLLATE Latin1_General_CI_AS is a case insensitive collation. This means that the SQL query will match the RFC column in both tables regardless of the case.

For example, if the RFC column in the ExportaComisiones table has the value “ABC123” and the RFC column in the optPerson table has the value “abc123”, the SQL query will match the two rows.

If you don’t use the COLLATE Latin1_General_CI_AS, the SQL query will not match the two rows.

The COLLATE Latin1_General_CI_AS is not necessary. You can remove it from the SQL query. However, you will need to make sure that the RFC column in both tables has the same case.

If you want to learn more about collations, check out this article.

Now that you know how to create a new dataframe and write it to a SQL table, let’s create a new dataframe and write it to a SQL table.

Create a new dataframe and write it to a SQL table

In this section, you’ll learn how to create a new dataframe and write it to a SQL table.

The first thing you’ll need to do is create a new dataframe.

Create a new dataframe

To create a new dataframe, you can use the following code:

df_comisiones_credifiel = pd.DataFrame()
The code above creates a new dataframe called df_comisiones_credifiel.

Now that you know how to create a new dataframe, let’s write the dataframe to a SQL table.

Write the dataframe to a SQL table

To write the dataframe to a SQL table, you can use the following code:

df_comisiones_credifiel.to_sql(name=’ComisionesCredifiel’, con=engine, if_exists=’replace’, index=False)
The code above writes the dataframe to a SQL table called ComisionesCredifiel.

The if_exists=’replace’ parameter makes sure that if the ComisionesCredifiel table already exists, it will be replaced.

The index=False parameter makes sure that the index column from the dataframe is not written to the SQL table.

Now that you know how to create a new dataframe and write it to a SQL table, let’s create a new dataframe and write it to a SQL table.

Create a new dataframe and write it to a SQL table

In this section, you’ll learn how to create a new dataframe and write it to a SQL table.

The first thing you’ll need to do is create a new dataframe.

Create a new dataframe

To create a new dataframe, you can use the following code

Similar Posts