I have two tables, Table_1 and Table_2. I want to compare one of the columns between the tables and have an output of the difference.
Specifically, I need to know which entries (of a column) of Table_1 are not present in table 2. I am using the EXCEPT operator but the numbers aren’t correct so I’d like to know how to make it case insensitive.
Here is my basic approach (without the case insensitive stuff):
<code>SELECT "Address" FROM Table_1
EXCEPT
SELECT "People Address" FROM Table_2
</code>
<code>SELECT "Address" FROM Table_1
EXCEPT
SELECT "People Address" FROM Table_2
</code>
SELECT "Address" FROM Table_1
EXCEPT
SELECT "People Address" FROM Table_2
So I thought I’d use:
<code>SELECT "Address" FROM Table_1
EXCEPT
SELECT "People Address" FROM Table_2
</code>
<code>SELECT "Address" FROM Table_1
EXCEPT
SELECT "People Address" FROM Table_2
</code>
SELECT "Address" FROM Table_1
EXCEPT
SELECT "People Address" FROM Table_2
To make it case insensitive, I’ve tried:
<code>SELECT "Address" COLLATE Latin1_General_CI_AS FROM Table_1
EXCEPT
SELECT "People Address" COLLATE Latin1_General_CI_AS FROM Table_2
</code>
<code>SELECT "Address" COLLATE Latin1_General_CI_AS FROM Table_1
EXCEPT
SELECT "People Address" COLLATE Latin1_General_CI_AS FROM Table_2
</code>
SELECT "Address" COLLATE Latin1_General_CI_AS FROM Table_1
EXCEPT
SELECT "People Address" COLLATE Latin1_General_CI_AS FROM Table_2
With the approoach above, I am getting the following error:
<code>db query error: pq: collation "Latin1_General_CI_AS" for encoding "UTF8" does not exist.
</code>
<code>db query error: pq: collation "Latin1_General_CI_AS" for encoding "UTF8" does not exist.
</code>
db query error: pq: collation "Latin1_General_CI_AS" for encoding "UTF8" does not exist.
How can I include case insensitivity? This is in PostgresSQL
2