Multiple IN - Mailing list pgsql-novice

From Leandro Fanzone
Subject Multiple IN
Date
Msg-id 3C16298C.A6204AD1@hasar.com
Whole thread Raw
Responses Re: Multiple IN
Re: Multiple IN
List pgsql-novice
Maybe this is a silly question. I have a table t with two fields f1 and
f2. Those fields together form the primary key. I want to select a list
of pairs from that table. The simplest SQL clause would be

SELECT * FROM t WHERE (f1 = v1 AND f2 = v2) OR (f1 = v3 AND f2 = v4)
...;

When that list is long, on the one hand I suppose it won't have a good
performance; on the other, the resultant clause is clumsy and too long.
Is there any other (more elegant) solution for this? If the field would
be just one, a simple IN would do better, but as far as I know there is
no IN for multiple fields.
Thank you in advance.

Leandro Fanzone


pgsql-novice by date:

Previous
From: "Duncan Adams (DNS)"
Date:
Subject: Re: sql help
Next
From: Bruno Wolff III
Date:
Subject: Re: Multiple IN