Re: IN vs EXIIST

From: Jean-Christian Imbeault <jc(at)mega-bucks(dot)co(dot)jp>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: IN vs EXIIST
Date: 2002-09-19 11:35:39
Message-ID: 3D89B68B.1020900@mega-bucks.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Jochem van Dieten wrote:
>
> SELECT key1, Min(CASE WHEN x THEN 1 ELSE 0 END) AS isTrue
> FROM table
> GROUP BY key1
> HAVING isTrue = 1

I tried this but got an error:

psql TMP -c "select invoice_id, min(case when received then 1 else 0
end) as ok from invoice_li group by invoice_id having ok = 1"

ERROR: Attribute 'ok' not found

Jc

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jochem van Dieten 2002-09-19 11:58:58 Re: IN vs EXIIST
Previous Message Jean-Christian Imbeault 2002-09-19 11:20:50 Re: IN vs EXIIST