Search Postgresql Archives

Re: IN query operator and NULL values

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On May 16, 2008, at 6:54 PM, Alban Hertroys wrote:

development=> select b, coalesce( (b in (1, null))::text, 'NULL') from test;
 b | coalesce
---+----------
 1 | true
 2 | NULL
   | NULL
(3 rows)

Just remembered a nice option from psql that doesn't quite clutter my example as much:

development=> \pset null '<NULL>'
Null display is "<NULL>".
development=> select b, b in (1, null) from test;
   b    | ?column?
--------+----------
      1 | t
      2 | <NULL>
 <NULL> | <NULL>
(3 rows)


Alban Hertroys

--
If you can't see the forest for the trees,
cut the trees and you'll see there is no forest.


!DSPAM:737,482dbd32927664852116061!




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux