Search Postgresql Archives

Re: [GENERAL] How tö select a column?

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

 



On Sat, Feb 18, 2017 at 9:33 AM, Egon Frerich <egon@xxxxxxxxxx> wrote:
I have a table with two columns with type money. If column 'a' has an
amount > 0 then this amount is wanted else the amount from column 'b'.


SELECT CASE WHEN a > 0 THEN a ELSE b END AS a_or_b FROM tbl​;

David J.

[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