Re: Querying a list of values

From: Aarni Ruuhimäki <aarni(at)kymi(dot)com>
To: "Vishal Kashyap (at) [SaiHertz]" <vishalonlist(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Querying a list of values
Date: 2004-11-18 18:35:38
Message-ID: 200411182035.38677.aarni@kymi.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi again,

And hmm, how about the other way round ?

SELECT *
FROM some_table
WHERE some_list contains a given value ?

Like in

WHERE some_list LIKE '%1%'

but only records that have '1' in the list and not '11', '12' etc ?

TIA,

Aarni

On Thursday 18 November 2004 14:49, Vishal Kashyap @ [SaiHertz] wrote:
> Aarni ,
>
>
> How about
>
> SELECT some_id, some_name
> FROM some_table
> WHERE some_id IN (YOUR LIST seperated with commas)
>
> Or you may go for arrays see contib for it.

--------------
This is a bugfree broadcast to you
from **Kmail**
on **Fedora Core 2** linux system
--------------

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2004-11-18 18:40:55 Re: lo_export
Previous Message alex 2004-11-18 18:22:53 multi-homed box