Re: case with distinct - Mailing list pgsql-bugs

From Tom Lane
Subject Re: case with distinct
Date
Msg-id 2842.976648158@sss.pgh.pa.us
Whole thread Raw
In response to case with distinct  (Merrill Oveson <merrill@actarg.com>)
List 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 by date:

Previous
From: Tom Lane
Date:
Subject: Re: constrains of array
Next
From: Stephan Szabo
Date:
Subject: Re: constrains of array