I m working on this query on mySQL - it seems to be processed on a website with PEAR and MDB2 on the running server (dont know why… din t do that myself). On my local test system it generates always MDB2 error. PHPmyadmin doesn t do this query as well. The Subselection is needed because there are not just one but four subselects in this query.
SELECT * FROM table1
WHERE table1.orderID
IN
(
SELECT *
FROM table1
LEFT JOIN table2
ON (table1.customID = table2.customID)
WHERE table1.active=1
)
我可以简化它这样(工作):
SELECT * FROM table1
WHERE table1.orderID
IN (1,2,3)
子选择也有效:
SELECT *
FROM table1
LEFT JOIN table2
ON (table1.customID = table2.customID)
WHERE table1.active=1
非常感谢你们的帮助!