Is there a way to check if a specific tuple exists in a table in a where-in statement?
Something like:
create table Test(A int, B int);
insert into Test values (3, 9);
insert into Test values (6, 7);
insert into Test values (7, 6);
insert into Test values (3, 4);
select A, B
from Test
where (B, A) in Test;
Expected output:
6|7
7|6
You were super close, the second half of an "in" clause has to be a select... so
SELECT A,B
FROM Test
WHERE (B,A) IN (SELECT B,A FROM Test);
The test (IN) must be in the same fields (or types of fields)