Re: SQL Question
От | |
---|---|
Тема | Re: SQL Question |
Дата | |
Msg-id | 20060110010843.36072.qmail@web33301.mail.mud.yahoo.com обсуждение исходный текст |
Ответ на | Re: SQL Question (Stephen Clouse <stephenclouse@gmail.com>) |
Список | pgsql-novice |
--- Stephen Clouse <stephenclouse@gmail.com> wrote: > On 1/6/06, operationsengineer1@yahoo.com > <operationsengineer1@yahoo.com> > wrote: > > > > and another sql question... > > > > greatly simplified info: > > > > t_sn > > sn_id > > sn > > > > t_inspect > > inspect_id > > sn_id (fkey) > > inspect_pass (boolean) > > > > i want to display all sns where there is not a > single > > instance of inspect_pass = t > > > This should get you what you're looking for: > > SELECT sn FROM t_sn > WHERE sn_id NOT IN > (SELECT sn_id FROM t_inspect > WHERE inspect_pass = t) perfect! thank you Stephen! so concise, too. beautiful! i was misapplying "not exists" and it was a mess. i had it displaying all or none of the sns. my last hurdle is to make my query also sort by inspection area... and i'll attack that tomorrow. thanks again. __________________________________________ Yahoo! DSL Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com
В списке pgsql-novice по дате отправления: