Sample Header Ad - 728x90

Select based on list of pairs

0 votes
1 answer
184 views
I have a table with two main columns, id1 and id2: drop table if exists pairs; create table pairs (id1 int, id2 int); insert into pairs values (1,2), (1,3), (3,1), (2,4), (5,4), (3,6), (7,8); I want to select rows which have these pairs [(1,2),(5,4),(3,1)]. This array could have more than 500 items, so how I can write a select query to select those rows? I am using 'Netezza' database but I need to find the logic to do this, I can figure out how to implement this logic in my database engine.
Asked by Majid Hojati (101 rep)
May 20, 2019, 11:25 PM
Last activity: Jul 18, 2025, 11:05 AM