Điều này sẽ đảm bảo rằng nó có cả hai
WHERE id IN
(
SELECT clientid
FROM campaigns
WHERE status IN ('L')
)
AND id IN
(
SELECT clientid
FROM campaigns
WHERE status IN ('P')
)
Hoặc thậm chí thử Truy vấn con với EXISTS
WHERE EXISTS
(
SELECT clientid
FROM campaigns
WHERE status IN ('L')
AND clientid = client.id
)
AND EXISTS
(
SELECT clientid
FROM campaigns
WHERE status IN ('P')
AND clientid = client.id
)