customer id | hobby
I would like to use mysql query to extract customers which have the same hobbies.
If someone has more hobbies we have one row for each hobby.
It is easy to use
SELECT customer_id
FROM customers
WHERE hobby='football'
My problem is that I want to search for two hobbies.
For example 'football
' and 'swimming
' and the query must result only the customers which have both.
Is it possible to do it with query or should I use stored procedure and how ?