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

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема [GENERAL] Re: [GENERAL] How tö select a column?
Дата
Msg-id CAKFQuwYt+EKF5Lefzgfe5Fd3b1-3iP5424Nm2ALwHURuAyzr0Q@mail.gmail.com
обсуждение исходный текст
Ответ на [GENERAL] How tö select a column?  (Egon Frerich <egon@frerich.eu>)
Список pgsql-general
On Sat, Feb 18, 2017 at 9:33 AM, Egon Frerich <egon@frerich.eu> 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.

В списке pgsql-general по дате отправления:

Предыдущее
От: Egon Frerich
Дата:
Сообщение: [GENERAL] How tö select a column?
Следующее
От: Nikolay Petrov
Дата:
Сообщение: [GENERAL] Unexpected WAL-archive restore behaviour