[thelist] mysql select query

Anne Thorniley anne at beerintheevening.com
Thu Apr 4 08:38:01 CST 2002


> so basically i've need a statement that does:
>
> select stuff from stories where published is not null and, if its a news
> story or a feature story, make sure live is not null, order by random limit 3
>

How about something like:

where published is not null and ((not news and not feature) or live is not null)

Anne

--
It's a dream
There's no need to tell me so
It's a dream
Don't you think I know?



More information about the thelist mailing list