Re: Conditional on Select List - Mailing list pgsql-general

From Tom Lane
Subject Re: Conditional on Select List
Date
Msg-id 26817.1210694857@sss.pgh.pa.us
Whole thread Raw
In response to Conditional on Select List  (Fernando <fernando@ggtours.ca>)
Responses Re: Conditional on Select List  (Fernando <fernando@ggtours.ca>)
List pgsql-general
Fernando <fernando@ggtours.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

pgsql-general by date:

Previous
From: "Adam Rich"
Date:
Subject: Re: Conditional on Select List
Next
From: "Douglas McNaught"
Date:
Subject: Re: Conditional on Select List