Re: IN clause

From: "surabhi(dot)ahuja" <surabhi(dot)ahuja(at)iiitb(dot)ac(dot)in>
To: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: IN clause
Date: 2006-11-24 12:01:07
Message-ID: 8626C1B7EB748940BCDD7596134632BE3986BA@jal.iiitb.ac.in
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

That is fine
but what I was actually expecting is this
if
select * from table where col_name in (null, 'a', 'b');

to return those rows where col_name is null or if it = a or if it is = b

But i think in does not not support null queries , am i right?

________________________________

From: pgsql-general-owner(at)postgresql(dot)org on behalf of A. Kretschmer
Sent: Fri 11/24/2006 2:59 PM
To: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] IN clause

am Fri, dem 24.11.2006, um 14:42:30 +0530 mailte surabhi.ahuja folgendes:
> Hi,
>
> i have a table
> and i have the query select * from table where col_name is null;
>
> it returns some rows
>
> now, say i have to implement the same query using the in clause how shold it be
> done?
>
> select * from table where col_name in (null);

select * from table where col_name is null or col_name in (...);

Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47215, D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alban Hertroys 2006-11-24 12:18:47 Re: IN clause
Previous Message Alexander Staubo 2006-11-24 11:02:36 Re: Stuck in "DELETE waiting"