Re: case statement within insert

Поиск
Список
Период
Сортировка
От Francisco Olarte
Тема Re: case statement within insert
Дата
Msg-id CA+bJJbyi-EXJaZDJNKs49nfEFFGp+ZWyEiW+vFYKaC7szQ_7Sg@mail.gmail.com
обсуждение исходный текст
Ответ на case statement within insert  (tango ward <tangoward15@gmail.com>)
Список pgsql-general
On Fri, May 25, 2018 at 11:04 AM, tango ward <tangoward15@gmail.com> wrote:
>                                           CASE
>         WHEN code like '%%PE%%' or code like '%%NSTP%%'
>         THEN True
>         ELSE False

I cannot advise you on the %% stuff, which I do not totally understand, but

CASE WHEN condition THEN true ELSE false END

when contition is ( as it should in a CASE ) a boolean expression is a
classic antipattern , just use 'condition' or '(condition)'

Francisco Olarte.


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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: case statement within insert
Следующее
От: Erlend Sogge Heggen
Дата:
Сообщение: Syndicating PostgreSQL mailing list to Discourse