Alright, so I am having issue with the following.. I am trying to do a single select statement with two sub queries. What I need it to do is the following pretty much..
SELECT * FROM messages WHERE the following conditions are meet.
condition 1:
SELECT id
FROM messages
WHERE `receiver` = 123510 && sender= 123457 && status != 3;
condition 2:
SELECT id
FROM messages
WHERE receiver = 123457 && sender = 123510 && status !=4;
I tried doing the following:
SELECT *
FROM messages
WHERE id IN (
(
SELECT id
FROM messages
WHERE `receiver` = 123510 && sender= 123457 && status != 3
),
(
SELECT id
FROM messages
WHERE receiver = 123457 && sender = 123510 && status !=4)
)
but when I do that mysql comes back with Subquery returns more than 1 row...
Any suggestions on how to solve this?
orthe two clauses together?where (r=1 and s=2 and status != 3) or (r=2 and s=1 and status != 4)