[thelist] Need help from any mySQL gurus on the list

Ed McCarroll Ed at ComSimplicity.com
Wed Mar 30 16:24:34 CST 2005


> I need some way to limit the result set so only uniquely private 
> stories are returned.

I’m not sure how MySQL does sub-queries, but in SQL Server, this would
work:

SELECT S.uid as uid, S.title as title
FROM news_stories as S, news_desk_stories as D
WHERE D.story = uid
  AND D.desk = 2"
  AND S.uid NOT IN
    (
    SELECT S2.uid
    FROM news_stories as S2, news_desk_stories as D2
    WHERE D2.story = S2.uid
      AND D2.desk <> 1"
    )
-- 
Ed McCarroll  (310) 838-4330
Ed at ComSimplicity.com http://www.ComSimplicity.com


More information about the thelist mailing list