Re: Ho w tö select a column?

From: Gavan Schneider <galeel(dot)pendari(at)bigpond(dot)com>
To: pgsql-general(at)postgresql(dot)org
Cc: "Egon Frerich egon-at-frerich(dot)eu |pg-gts/Basic|" <72xajq443t(at)sneakemail(dot)com>
Subject: Re: Ho w tö select a column?
Date: 2017-02-19 20:41:17
Message-ID: r470Ps-10123i-3533FD046DBB4407B2E2C955B829FCC0@Rosebud.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Güttler 2017-02-19 21:31:00 Re: PostgreSQL on eMMC - Corrupt file system
Previous Message Rakesh Kumar 2017-02-19 16:52:29 Indexes and MVCC