Re: case with distinct

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: case with distinct
Дата
Msg-id 2842.976648158@sss.pgh.pa.us
обсуждение исходный текст
Ответ на case with distinct  (Merrill Oveson <merrill@actarg.com>)
Список pgsql-bugs
Merrill Oveson <merrill@actarg.com> writes:
> This doesn't:
>      select distinct
>             orgid,
>             case when status = 'y' then '1' else '0' end
>             from vend

Try

 select distinct
            orgid,
            case when status = 'y' then '1'::text else '0'::text end
            from vend

7.1 is less picky about unknown-type constants...

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: constrains of array
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: constrains of array