Skip to content
Advertisement

get records that doesnt exists in another table

I have a temp table over a 1000 rows but for example purposes as follows

#Table

and then i have another table as follows (this is not a temp table) Compliance Table

how do i check if the records from the temp table doesnt exists in the Compliance table per its ID and Code

so from the above data i would want the following out put

Items that dont match: output table

from the 4 records in the #temp table 3 of the above records dont exists in the compliance table

Advertisement

Answer

Just use not exists:

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement