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 3EE19D1CA64 for ; Fri, 30 Apr 2004 05:18:53 -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 86685-05 for ; Fri, 30 Apr 2004 05:18:34 -0300 (ADT) Received: from boss.intranet.noze.it (unknown [213.26.229.146]) by svr1.postgresql.org (Postfix) with ESMTP id 94583D1CA6E for ; Fri, 30 Apr 2004 05:18:29 -0300 (ADT) Received: from localhost (localhost.localdomain [127.0.0.1]) by boss.intranet.noze.it (Postfix) with ESMTP id 6F281262801C; Fri, 30 Apr 2004 10:18:17 +0200 (CEST) Received: from boss.intranet.noze.it ([127.0.0.1]) by localhost (boss.intranet.noze.it [127.0.0.1]) (amavisd-new, port 10024) with SMTP id 10689-10; Fri, 30 Apr 2004 10:18:16 +0200 (CEST) Received: from macbeth.intranet.noze.it (macbeth.intranet.noze.it [192.168.0.70]) by boss.intranet.noze.it (Postfix) with ESMTP id A57D1262801B; Fri, 30 Apr 2004 10:18:16 +0200 (CEST) Subject: Re: Check a value in array From: Marco Lazzeri To: Rod Taylor Cc: pgsql-sql@postgresql.org In-Reply-To: <1083261407.30065.303.camel@jester> References: <1083260230.20352.7.camel@macbeth.intranet.noze.it> <1083261407.30065.303.camel@jester> Content-Type: text/plain Message-Id: <1083313092.7734.3.camel@macbeth.intranet.noze.it> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Fri, 30 Apr 2004 10:18:13 +0200 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at noze.it 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: 200404/332 X-Sequence-Number: 17707 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.