From: Oleg Bartunov <oleg@sai.msu.su>
To: Sophie Yang <yangsophie@yahoo.com>
Cc: pgsql-general@postgresql.org
Cc: pgsql-novice@postgresql.org
Cc: pgsql-sql@postgresql.org
Subject: Re: [SQL] Set Membership operator -- test group membership
Date: Sun, 19 Jun 2005 12:48:12 +0400 (MSD)
Message-ID: <Pine.GSO.4.63.0506191248020.1850@ra.sai.msu.su> (raw)
In-Reply-To: <20050614190840.32862.qmail@web53706.mail.yahoo.com>
References: <20050614190840.32862.qmail@web53706.mail.yahoo.com>
Look contrib/intarray
On Tue, 14 Jun 2005, Sophie Yang wrote:
> 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
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>
Regards,
Oleg
_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83
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: oleg@sai.msu.su, yangsophie@yahoo.com, pgsql-general@postgresql.org, pgsql-novice@postgresql.org
Subject: Re: [SQL] Set Membership operator -- test group membership
In-Reply-To: <Pine.GSO.4.63.0506191248020.1850@ra.sai.msu.su>
* 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