[thelist] SQL question

Joshua Olson joshua at waetech.com
Thu Aug 22 17:48:01 CDT 2002


----- Original Message -----
From: "Lauri Vain" <lauri_lists at tharapita.com>
Sent: Thursday, August 22, 2002 5:14 PM


> 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.

Lauri, my solution will not work.  However, the double inner join will work.
You might have to play with it to get it to work for you in the real-world
example, but the simplified example will look like this:

SELECT *
FROM (first
INNER JOIN second s1
  ON first.comp_id = s1.comp_id AND s1.www_id = 2)
INNER JOIN second s2
  ON first.comp_id = s2.comp_id AND s2.www_id = 4
WHERE first.comp_id = 1

-joshua




More information about the thelist mailing list