Re: Multiple IN - Mailing list pgsql-novice

From Josh Berkus
Subject Re: Multiple IN
Date
Msg-id web-525488@davinci.ethosmedia.com
Whole thread Raw
In response to Multiple IN  (Leandro Fanzone <leandro@hasar.com>)
List pgsql-novice
Leandro,

> 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)
> ...;

We'll need database schema (table designs) if you want us to help you.
The above isn't enough information to go on.  For example, where did
"v1" come from?  Is this a field?  An interface language variable?

Please be explicit!  Also, consider picking up Joe Celko's SQL for
Smarties, reviewed at http://techdocs.postgresql.org/bookreviews.php

-Josh

______AGLIO DATABASE SOLUTIONS___________________________
                                       Josh Berkus
  Complete information technology      josh@agliodbs.com
   and data management solutions       (415) 565-7293
  for law firms, small businesses        fax 621-2533
    and non-profit organizations.      San Francisco

pgsql-novice by date:

Previous
From: "Josh Berkus"
Date:
Subject: Re: Storing number '001' ?
Next
From: Luis Amigo
Date:
Subject: trouble with query