From: | Sophie Yang <yangsophie(at)yahoo(dot)com> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Cc: | pgsql-novice(at)postgresql(dot)org, pgsql-sql(at)postgresql(dot)org |
Subject: | Set Membership operator -- test group membership |
Date: | 2005-06-14 19:08:39 |
Message-ID: | 20050614190840.32862.qmail@web53706.mail.yahoo.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general pgsql-novice pgsql-sql |
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
From | Date | Subject | |
---|---|---|---|
Next Message | Michal Hlavac | 2005-06-14 19:15:10 | Re: suse 9.2 |
Previous Message | Danny Gaethofs | 2005-06-14 17:52:58 | server not starting |
From | Date | Subject | |
---|---|---|---|
Next Message | operationsengineer1 | 2005-06-14 19:18:10 | PGDATA |
Previous Message | Havasvölgyi Ottó | 2005-06-14 16:31:09 | Re: need suggestion for server sizing |
From | Date | Subject | |
---|---|---|---|
Next Message | Igor Katrayev | 2005-06-14 19:27:30 | Re: Set Membership operator -- test group membership |
Previous Message | Tom Lane | 2005-06-14 13:37:22 | Re: foreign key on pg_shadow |