Re: Check a value in array

From: Marco Lazzeri <marcomail(at)noze(dot)it>
To: Rod Taylor <pg(at)rbt(dot)ca>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Check a value in array
Date: 2004-04-30 08:18:13
Message-ID: 1083313092.7734.3.camel@macbeth.intranet.noze.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Il gio, 2004-04-29 alle 19:56, Rod Taylor ha scritto:
> On Thu, 2004-04-29 at 13:37, Marco Lazzeri wrote:
> > Hi all.
> >
> > I have to check if a value is in an array.
> >
> > I've got a date array in a table and I would like to perform queries
> > like:
> >
> > SELECT * FROM table WHERE date IN dates_array;
>
> If you're using 7.4 or later, try:
>
> SELECT * FROM table WHERE date = ANY(dates_array);
>
> This will work without the contrib package.

Thank you Rod, I forgot to specify I'm using PostgreSQL 7.3.5.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message francescosaf 2004-04-30 09:25:28 Re: problem with slow select
Previous Message CoL 2004-04-30 07:14:32 Re: isnumeric() function?