MySQL Forums
Forum List  »  Newbie

Re: Finding like rows based on one of two fields
Posted by: Paul Ille
Date: August 16, 2015 12:00PM

Ok I guess I would have to count the number of persons involved and then look for a count that equals that number like so.

SELECT id, person_id, game_id, count(game_id) as games FROM persons_favorite_games
where person_id = '26' or person_id = '92' or person_id = '89'
group by game_id
having count(game_id) = 3

I realize I'm talking to myself in this thread :) Anyone who chimes in is greatly appreciated.

Options: ReplyQuote


Subject
Written By
Posted
Re: Finding like rows based on one of two fields
August 16, 2015 12:00PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.