I'm searching my submission fields for users that signed up for two different projects. This is what I have, that is not working correctly. Any help would be great!
SELECT
user_id, COUNT(*)
FROM submissions
WHERE
project_id = 125
or project_id = 81
group by
user_id
HAVING COUNT(*) >= 2
So to clarify, I want to know what users have a submission from project_id 81 AND project_id 125. Each of the submissions
The right sintax is this one, you're missing a *
in case a user can submit the same project multiple times, it's better to write your HAVING condition like this:
so we can be sure that it will match two different distinct projects, and not just one project submitted multiple times