[thelist] sql query help

Means, Eric D eric.d.means at boeing.com
Fri May 24 10:08:20 CDT 2002


>  -----Original Message-----
> From: 	Chris Blessing [mailto:webguy at mail.rit.edu]
> Sent:	Friday, May 24, 2002 9:00 AM
> To:	thelist at lists.evolt.org
> Subject:	[thelist] sql query help
>
> I thought something like this might work but it just returns some
arbitrary
> number of articles...
>
> select article_id from paragraphs
> where sort_order = 1
> group by article_id
> having count(article_id) > 1

How about


Select article_id from paragraphs
Where not exists (select distinct article_id from paragraphs where
sort_order > 1)

That will filter out any and all articles that have any non-1 sort order
paragraphs.
It will return articles with only one paragraphs, but it's at least a step
in the right direction.



More information about the thelist mailing list