Thread: IN/NOT IN operators

IN/NOT IN operators

From
"Sergei Chernev"
Date:
Hello,
I want to ask you if there are the way to do:
select * from aa where (bb, ff) IN ((2,3),(4,5));
ERROR:  parser: parse error at or near "2"    :((

I see that it works with subselect:
select * from aa where (bb, ff) IN (select (bb,ff) from zz);


Thank you,
---------------------------
Sergei Chernev
Internet: ser@nsu.ru
Phone: +7-3832-397354


Re: [GENERAL] IN/NOT IN operators

From
Bruce Momjian
Date:
[Charset koi8-r unsupported, filtering to ASCII...]
> Hello,
> I want to ask you if there are the way to do:
> select * from aa where (bb, ff) IN ((2,3),(4,5));
> ERROR:  parser: parse error at or near "2"    :((
>
> I see that it works with subselect:
> select * from aa where (bb, ff) IN (select (bb,ff) from zz);
>
>
> Thank you,
> ---------------------------
> Sergei Chernev
> Internet: ser@nsu.ru
> Phone: +7-3832-397354
>
>
>

select * from aa where (bb, ff) IN
        (
            select 2,3
            union
            select 4,5
        )

Does this work?


--
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026