i'm trying to do a query with the INTERSECT clause but PHPmyAdmin don’t recognize INTERSECT and this is the error :
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTERSECT (SELECT users.name, users.id, users.email FROM users ' at line 10
I can't understand and i haven't found a problem like this. So any solutions please ? Thanks
SELECT users.name, users.id, users.email
FROM users
WHERE users.id NOT IN (
SELECT users.id
FROM users
JOIN clubs_messages ON users.id = clubs_messages.id_user
GROUP BY clubs_messages.id_user)
INTERSECT
SELECT users.name, users.id, users.email
FROM users
WHERE users.id NOT IN (
SELECT users.id
FROM users
JOIN sessions_messages ON users.id = sessions_messages.id_user
GROUP BY sessions_messages.id_user)