Re: [GENERAL] How tö select a column? - Mailing list pgsql-general

From Gavan Schneider
Subject Re: [GENERAL] How tö select a column?
Date
Msg-id r470Ps-10123i-3533FD046DBB4407B2E2C955B829FCC0@Rosebud.local
Whole thread Raw
In response to [GENERAL] How tö select a column?  (Egon Frerich <egon@frerich.eu>)
List pgsql-general
On 2/18/17 at 3:33 AM, Egon Frerich 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'.
>
Examples in 4.2.14

SELECT CASE WHEN a > 0 THEN a ELSE b END FROM <money_table>
WHERE <whatever>;

Regards
Gavan Schneider



pgsql-general by date:

Previous
From: Rakesh Kumar
Date:
Subject: [GENERAL] Indexes and MVCC
Next
From: Thomas Güttler
Date:
Subject: Re: [GENERAL] PostgreSQL on eMMC - Corrupt file system