Hello,
Basically I got a small event system going on, but I'm having a couple of strange SQL query problems. 1st one I need to find all peoples names which have signed up for all 3 events. I tried to do:
SELECT name
FROM users
NATURAL JOIN events
WHERE events.id = '4' AND events.id = '7' AND events.id = '8'
But it returns zero rows, even tho there are users that have signed up for all 3 events
2nd one, I need to find a people who signed up for event 4 but not for event 7 I tried:
SELECT name
FROM users
NATURAL JOIN events
WHERE events.id = '4' AND events.id !='7'
It returns the same results as without the != mark, as it should at least be eliminating a few results.
Thanks in advance.