I want to get the playerid of those who played both chess and checkers. I have a table that's like this:
playerid game website
a1 chess www.abc.com
a2 checkers www.cba.com
a1 checkers www.abc.com
b2 chess www.abc.com
b1 chess www.abc.com
a3 checkers www.aaa.com
b2 checkers www.abc.com
Desired output (a3 and b1 should be excluded)
a1
b2
select game, playerid, website
from player_db
where (game= 'chess' or game= 'checkers') and website='abc.com'
group by playerid ;
This is my SQL, but it doesn't seem to be getting both of the games -- it selects either chess or checkers.