dbmab's solution scales better:
Code:
SELECT place, count(*) as cnt
FROM your_table
WHERE name = 'marianne' OR name = 'morgan'
GROUP BY place
HAVING cnt = 2
note that the names can be an IN list instead, making it easier to read with more names:
Code:
SELECT place, count(*) as cnt
FROM your_table
WHERE name IN ('marianne','morgan')
GROUP BY place
HAVING cnt = 2
so if you want to find which cities have been visited by four friends, you expand the name list and change the count:
Code:
SELECT place, count(*) as cnt
FROM your_table
WHERE name IN ('larry','curly','moe','shemp')
GROUP BY place
HAVING cnt = 4