January 12, 2017 at 5:14 am
Hi,
I am just looking for some pseudo code/logic for a SQL script I am going to create.
I have two tables that are related, one is called entry and the other is called item. One entry can have many items. The item entry has a foreign key that can link to the entry's primary key.
In the item table there is a status code attribute which can be any number from 1 to 15.
I want to create a script that will look for any entry where all the relating items are status 7.
I hope this makes sense. Ithink I am going to kick myself when I work it out.
Paul
January 12, 2017 at 5:25 am
Something likeSELECT * FROM Entry WHERE EntryID NOT IN (SELECT EntryID FROM Items WHERE Status <> 7)
Thomas Rushton
blog: https://thelonedba.wordpress.com
January 12, 2017 at 6:02 am
thank you ever much ThomasRushton!
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply