It works.
Also consider views.
Just used this on a my db:
SELECT * FROM tblcus_customer
INNER JOIN
( SELECT * FROM tblcus_customer_status WHERE status_id > 0) AS b
ON tblcus_customer.status = b.status_id
This query is the same as a normal JOIN:
SELECT *
FROM tblcus_customer
INNER JOIN
tblcus_customer_status b
ON tblcus_customer.status = b.status_id AND b.status_id > 0
or
SELECT *
FROM tblcus_customer
INNER JOIN
tblcus_customer_status b
ON tblcus_customer.status = b.status_id
WHERE b.status_id > 0
But you can JOIN on SELECTs selecting arbitrary stuff.
--
Andreas Joseph Krogh <andreak@officenet.no> mob: +47 909 56 963
Senior Software Developer / CTO - OfficeNet AS - http://www.officenet.no
Public key: http://home.officenet.no/~andreak/public_key.asc