I am trying to create an SQL query to find the number of users singed up to both games

E.GibSaan Source

example table

Here is the table in question, I don't really know where to start.

sqlselect

Answers

answered 1 week ago Mureinik #1

You can group by the user name, and then count many games a user is signed up to:

SELECT   username
FROM     mytable
GROUP BY username
HAVING   COUNT(DISTINCT gamename) = 2

comments powered by Disqus