X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 4A685528AD for ; Tue, 14 Jun 2005 16:08:47 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 38776-06 for ; Tue, 14 Jun 2005 19:08:41 +0000 (GMT) Received: from web53706.mail.yahoo.com (web53706.mail.yahoo.com [206.190.37.27]) by svr1.postgresql.org (Postfix) with SMTP id 45E31528C1 for ; Tue, 14 Jun 2005 16:08:40 -0300 (ADT) Received: (qmail 32865 invoked by uid 60001); 14 Jun 2005 19:08:40 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding; b=U52hQUjeXHgxRGeIjeurFX1ojzNJowcy9bzpZWDBRGrB1kX4izRRXO68x9Ysa0bL1nP8VrhwqYfFmkL0DsGtRlUdrKC8BQhr+eaWqa6dss46L5CjRBKJ44W9nCBo3FG6iudvndkU/Gihd+Rb7Hi91iSC5oavk3iTruSK4+zfrNk= ; Message-ID: <20050614190840.32862.qmail@web53706.mail.yahoo.com> Received: from [132.249.100.230] by web53706.mail.yahoo.com via HTTP; Tue, 14 Jun 2005 12:08:39 PDT Date: Tue, 14 Jun 2005 12:08:39 -0700 (PDT) From: Sophie Yang Subject: Set Membership operator -- test group membership To: pgsql-general@postgresql.org Cc: pgsql-novice@postgresql.org, pgsql-sql@postgresql.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.75 tagged_above=0 required=5 tests=DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST X-Spam-Level: * X-Archive-Number: 200506/680 X-Sequence-Number: 79388 Say I have a table tbl1 with two columns: tbl1(a integer, b integer, c integer) I want to select the rows in which a and b are members of a list of integer pairs. The SQL in my mind is something like: select * from tbl1 where (a, b) in ((1, 20), (2, 30), (3, 50)); I know the SQL above does not work in PostgreSQL. I wonder what is the proper way to use in PostgreSQL. I tried "select * from tbl1 where (a, b) in ('{{1, 20}, {2, 30}, {3, 50}}')", and it doesn't work either. Thanks! Sophie __________________________________ Yahoo! Mail Mobile Take Yahoo! Mail with you! Check email on your mobile phone. http://mobile.yahoo.com/learn/mail