I have a table T1 with 2 columns
C1 | C2
---------------
W1 p1
W1 p2
W2 P1
W2 p2
W2 p3
w3 p1
W3 p2
I have a set of records: Select * from T1 wehre C1 = W1
What I want is records that is equivalent to W1 in terms of of its parts list. Ie any results from Column C1 should have same parts as w1.
result should be W1 = W3 but not W2
how Can I acheive this?
------
The above problem can be More complex if there are aliases for parts in Column C2. For example a light change in the part list for W3. Where P4 is put instead of P2. P4 is alias of P2 ie P4=P2.
C1 | C2
---------------
W1 p1
W1 p2
W2 P1
W2 p2
W2 p3
w3 p1
W3 p4
Where P4 = P2 and all such alias information is kept in another mapping table MT. Expected result in this case is identical to first case is W1 and W3 should be in result set.
I could think of doing this easily if MySQL had intersection but it does not support and I dont know how I could achieve it otherwise. Any help from the community will be highly appriciated.
Thank you,