I need a sql that will retrieve records that do not exist on a table.
For instance - I will have the following list of sparetypeid's:
(899007503,899004873,89900
3448,89900
7504,89900
1620)
and i'm querying sparetype table.
i want to know which of these 5 sparetypeid's from my list DO NOT exist in sparetype table?
I don't want a retrieval of every single sparetypeid from the table just from MY list that do not belong in table.
something like lets say sparetype table contains 899007503 , 100001,200001,300001 only
select distinct sparetypeid
from sparetype
where sparetypeid not exists In (899007503,899004873,89900
3448,89900
7504,89900
1620)
should then return 899004873,899003448,899007
504,899001
620 bc they do not exist in table.
thanks in advance
Start Free Trial