Re: SQL Question

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: SQL Question
Дата
Msg-id 29756.984082434@sss.pgh.pa.us
обсуждение исходный текст
Ответ на SQL Question  (Matthew <matt@ctlno.com>)
Список pgsql-general
Matthew <matt@ctlno.com> writes:
> What I would like is something like this (using pseudo sql)
> select (if(col1>1) true else if (col1<= 1) false) from foo;

This particular example could be written as just

    select col1>1 from foo

since a boolean result is a perfectly good result.

More generally, you could use the CASE construct for conditional
expressions.  See
http://www.postgresql.org/devel-corner/docs/postgres/functions-conditional.html

            regards, tom lane

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

Предыдущее
От: "Roderick A. Anderson"
Дата:
Сообщение: Re: Update through views?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: inheritance and primary/foreign keys