Quantcast
Channel: SELECT for values in a table - Database Administrators Stack Exchange
Browsing all 2 articles
Browse latest View live

Answer by Erwin Brandstetter for SELECT for values in a table

SELECT x.id1, x.id2 FROM tbl xWHERE EXISTS ( SELECT * FROM tbl y WHERE (y.id1, y.id2) = (x.id2, x.id1) );Assuming that the combination of (id1, id2) is unique, so no DISTINCT. This would still allow...

View Article



SELECT for values in a table

I have this table structure:id1 id2 1 2 1 3 2 1 2 4id1 and id2 are not unique as you can see in the values. I need to retrieve those values that exists in the two columns meaning id1=1,2 id2=2,1. Any...

View Article
Browsing all 2 articles
Browse latest View live




Latest Images