Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Sql Server – Get record where not exist on other table

I have two tables:

enter image description here enter image description here

I want to get result in Campaign table – > 55,100.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Because they don’t exist in Job table.

>Solution :

You can use a not exists condition:

SELECT *
FROM   campaign c
WHERE  NOT EXISTS (SELECT *
                   FROM   jobs j
                   WHERE  j.campaignid = c.campaignid)
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading