Re: Conditional on Select List

From: Fernando <fernando(at)ggtours(dot)ca>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Conditional on Select List
Date: 2008-05-13 16:40:18
Message-ID: 4829C472.7080006@ggtours.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thanks this is exactly what I need it.

Fernando

Tom Lane wrote:
> Fernando <fernando(at)ggtours(dot)ca> writes:
>
>> Is it possible to do this?
>> SELECT IF(COUNT(colname) > 0, TRUE, FALSE) AS colname FROM table;
>>
>
> SELECT COUNT(colname) > 0 AS colname FROM table;
>
> If you really like to type, you could use a CASE expression.
>
> regards, tom lane
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Guillaume Lelarge 2008-05-13 16:48:38 Re: pg_standby / WAL archive-restore through system restarts
Previous Message Tom Lane 2008-05-13 16:34:51 Re: too many warnings