[thelist] SQL question

Michael K. Ahn mike at ahnfire.com
Thu Aug 22 16:29:01 CDT 2002


Select * From F, S
WHERE F.COMP_ID = S.COMP_ID AND (S.WWW_ID = 2 OR S.WWWW_ID = 4)

If your sql app doesn't like that syntax... this is a bit more
generalized
Select * From F, S
WHERE	(F.COMP_ID = S.COMP_ID AND S.WWW_ID = 2) OR
	(F.COMP_ID = S.COMP_ID AND S.WWW_ID = 4)

Michael

-----Original Message-----
From: Lauri Vain [mailto:lauri_lists at tharapita.com]
Sent: Thursday, August 22, 2002 5:14 PM
To: thelist at lists.evolt.org
Subject: RE: [thelist] SQL question

> SELECT * FROM first as f, second as s
> WHERE  f.comp_id = 1
> AND f.comp_id = s.comp_id
> AND s.www_id IN (2,4)

That unfortunately translates to conditions where s.www_id is either 2
OR 4.  Note the "OR"... it should be "AND".

I will check into Joshua's and David's ideas. This system was on MySQL,
which does not support subselects, so that might not work. Fingers
crossed.

Thanks,
Lauri

--
For unsubscribe and other options, including
the Tip Harvester and archive of thelist go to:
http://lists.evolt.org Workers of the Web, evolt !



More information about the thelist mailing list