SQL not exsist statement

I need to find if a entry of one column that does not  exsists in another table. so I want a list of all the ItemClassComponents.itemID that are not in the Item.ID column.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Raja Jegan RSQL Server DBA & Architect, EE Solution GuideCommented:
Try this

Select ItemClassComponents.itemID
from ItemClassComponents LEFT JOIN Item on ItemClassComponents.itemID = Item.ID
where Item.ID is null

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Aneesh RetnakaranDatabase AdministratorCommented:
FROM ItemClassComponents
WHERE NOT EXISTS (SELECT 1 FROM Item WHERE Item.ID  =  ItemClassComponents.itemID   )
DKJDAAuthor Commented:
Thanks for the help both are correct.  Not sure if i should split the points or award to first responder. which is the proper etiquette?
Powerful Yet Easy-to-Use Network Monitoring

Identify excessive bandwidth utilization or unexpected application traffic with SolarWinds Bandwidth Analyzer Pack.

Raja Jegan RSQL Server DBA & Architect, EE Solution GuideCommented:
You can split it across two posts since there is no much time difference..
DKJDAAuthor Commented:
Aneeshattingal, thanks for your help ! Would you mind explaining what the "1" is in your solution?
Raja Jegan RSQL Server DBA & Architect, EE Solution GuideCommented:
If you use Exists, then either 1 or column name represents the same..
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2008

From novice to tech pro — start learning today.