Re: case with distinct

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Merrill Oveson <merrill(at)actarg(dot)com>
Cc: "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>, kyle(at)actarg(dot)com
Subject: Re: case with distinct
Date: 2000-12-12 19:09:18
Message-ID: 2842.976648158@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Merrill Oveson <merrill(at)actarg(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Stephan Szabo 2000-12-12 19:40:35 Re: constrains of array
Previous Message Tom Lane 2000-12-12 19:04:32 Re: constrains of array