If a table “XYZ” contains two columns as combine primary key, I need to select records that contain both Value1
and Value2 in COLUMN_B ( Result: ID4 )
I tried with “IN” query but it returns the records which contain VALUE1
OR VALUE2 in COLUMN_B (ID1, ID2, ID3, ID4).
Can anybody please help me to write a MySQL query that can do this.
COLUMN_A COLUMN_B ID1 Value1 ID2 Value1 ID3 Value2 ID4 Value1 ID4 Value2 ID5 Value3 ID3 Value3
Thanks in Advance.