如何使 NOT IN 与 JOIN 语句一起使用?下面是我的查询:
SELECT A.*
FROM products A
LEFT OUTER JOIN productmeta B ON A.id=B.product_id
WHERE(B.group_id IS NULL OR B.group_id=0)
AND (B.collection_id IS NULL OR B.collection_id=0)
AND B.id NOT IN (SELECT collection_id FROM collections)