Two tables:
t1 = a list of ID's as int (1 - 100)
t2 = a list of ID's from t1 that get used during a year (2,4,6,8,9,20)
How do I get a list of ID's from t1 that are NOT also listed in t2? (the ones unused in t1)
I can easily get it when I want the ones used, but the unused is not working right.
Thanks
Simple query help please
Moderator: General Moderators
Re: Simple query help please
SELECT id FROM t1 WHERE NOT id IN (SELECT id FROM t2)
Just curious: if you had difficulty selecting the unused ones, but you were able to easily select the used ones, how did you do it?
Just curious: if you had difficulty selecting the unused ones, but you were able to easily select the used ones, how did you do it?
Re: Simple query help please
Thanks, that worked great.
I just did a simple SELECT on the two tables and compared id's
I've got to study more, that's for sure.
Thanks
I just did a simple SELECT on the two tables and compared id's
I've got to study more, that's for sure.
Thanks