Possible Duplicate:
Intersect in mysql
I have do a php project for retrieving common data.I am little weak in writing MySQL query. i was tried different ways .But i cannot get proper output
My table is
Id Product-1 product-2
-------------------------
1 A B
2 B C
3 C A
4 E B
5 H C
This is my table .I want to write a MySQL query retrieve common elements. eg: Here A,B be will comes to Product-1,Product-2, I want to retrieve common element element of A,B Here The output is C
3 C A
2 B C
both row can contain either A,B in Product-1 or product-2
Same like A,c common element is B .How to write Query for this... in sql we can use Intersect operation But MySQL i don't have any idea .Please help me...