I want to get rows from database. I am using the following query:
select * from Table where columnB = '1' AND '3';
I want to get rows in which column A has the same value and columnB is either 1 and 3. I don’t want any single row of columnA.
I want to retrieve rows in pairs on the basis of value in column A. There should no single row with value of column A
EDIT: Still not sure I understand your question, but…
if you want all rows with B=’1′ such that there’s also another row with B=’3′ and both rows have the same value of A, as well as all rows with B=’3′ such that there’s also another row with B=’1′ and both rows have the same value of A, then something like this should work:
Your output will be something like this: