Jib'z
Jib'z

Reputation: 1003

How to find element that are not present in a table

I have a list of hundreds codes like :

'123XXX465', '321YYY654',..., '789ZZZ321'

And a table A with a column Code I want to find easily all codes that are not in the table A and I have no clues on how to do this.

Thx for your help.

Upvotes: 0

Views: 92

Answers (1)

White Feather
White Feather

Reputation: 2783

Make a table B with column list_code and import your list, then:

SELECT
B.list_code,
A.Code
FROM B
LEFT JOIN A ON B.list_code=A.Code
WHERE A.Code IS NULL;

Regards

Upvotes: 2

Related Questions