X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 7CB90D1F088 for ; Tue, 4 May 2004 12:04:01 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 99688-06 for ; Tue, 4 May 2004 12:03:40 -0300 (ADT) Received: from ar-sd.net (unknown [81.196.32.112]) by svr1.postgresql.org (Postfix) with ESMTP id BB1B1D1B8E2 for ; Tue, 4 May 2004 12:03:39 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by ar-sd.net (Postfix) with ESMTP id 1309D1F6C1; Tue, 4 May 2004 17:55:25 +0300 (EEST) Received: from forge (unknown [192.168.0.11]) by ar-sd.net (Postfix) with SMTP id E8F6417A8F; Tue, 4 May 2004 17:55:24 +0300 (EEST) Message-ID: <010801c431e9$02e24220$0b00a8c0@forge> From: "Contact AR-SD.NET" To: "Marco Lazzeri" , "Rod Taylor" Cc: References: <1083260230.20352.7.camel@macbeth.intranet.noze.it> <1083261407.30065.303.camel@jester> <1083313092.7734.3.camel@macbeth.intranet.noze.it> Subject: Re: Check a value in array Date: Tue, 4 May 2004 18:03:50 +0300 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2720.3000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2739.300 X-Virus-Scanned: by AMaViS snapshot-20020531 X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200405/47 X-Sequence-Number: 17761 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" To: "Rod Taylor" Cc: 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 >