Let me explain this a bit.
Imagine I have a table like this:
id | xid | name
---------------
1 | 29 | hi
2 | 29 | this
3 | 38 | an
4 | 87 | example
5 | 87 | for
6 | 29 | stackoverflow
I want to select only the rows that have 3 xid in common, so in this example it would be:
id | xid | name
----------------
1 | 29 | hi
2 | 29 | this
6 | 29 | stackoverflow
How can I achieve this with just one MySQL query?
Try this