hi, i have a table like this:
+------------------------+
|Key| value | name |
+---+-------+------------+
1 A john
2 B Mary
3 C Ben
4 A Ben
5 B john
6 C Mary
how can i do a select which returns who has values of "A" and "B" (in this case, only "john")
I have this ugly one sql now..
SELECT * FROM table where value="A" or value="B" group by name having count(name) >1 ;
can someone tell me an more elegant way?