Re: How to fetch rows with multiple values

From: Richard Huxton <dev(at)archonet(dot)com>
To: Keary Suska <hierophant(at)pcisys(dot)net>
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to fetch rows with multiple values
Date: 2006-01-20 16:11:50
Message-ID: 43D10BC6.90402@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Keary Suska wrote:
>> Data looks something like this:
>>
>> "john" 1
>> "peter" 1

>
> Maybe I'm a little thick this morning but can't you just do:
>
> SELECT "ID" from customer_mapping WHERE "Name"='john' OR "Name"='peter' OR
> "Name"='george' ORDER BY "ID" DESC

Not quite. He's after ID that have *both* names, so ID=1 above because
it has "john" AND "peter".

--
Richard Huxton
Archonet Ltd

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Csaba Nagy 2006-01-20 16:18:47 Re: autovacuum and temporary tables
Previous Message Sebastjan Trepca 2006-01-20 16:08:57 Re: How to fetch rows with multiple values