From: Contact AR-SD.NET <contact@ar-sd.net>
To: Marco Lazzeri <marcomail@noze.it>
To: Rod Taylor <pg@rbt.ca>
Cc: pgsql-sql@postgresql.org
Subject: Re: Check a value in array
Date: Tue, 4 May 2004 18:03:50 +0300
Message-ID: <010801c431e9$02e24220$0b00a8c0@forge> (raw)
References: <1083260230.20352.7.camel@macbeth.intranet.noze.it>
<1083261407.30065.303.camel@jester>
<1083313092.7734.3.camel@macbeth.intranet.noze.it>
select * from table where date in ('02/02/2004', '02/03/2004' .... )
i'm using pgsql 7.3.2 and it works fine.
Andy.
----- Original Message -----
From: "Marco Lazzeri" <marcomail@noze.it>
To: "Rod Taylor" <pg@rbt.ca>
Cc: <pgsql-sql@postgresql.org>
Sent: Friday, April 30, 2004 11:18 AM
Subject: Re: [SQL] Check a value in array
> 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.
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: the planner will ignore your desire to choose an index scan if your
> joining column's datatypes do not match
>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: contact@ar-sd.net, marcomail@noze.it, pg@rbt.ca
Subject: Re: Check a value in array
In-Reply-To: <010801c431e9$02e24220$0b00a8c0@forge>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox