Problems with HAVING

From: Kaloyan Iliev Iliev <news1(at)faith(dot)digsys(dot)bg>
To: pgsql-sql(at)postgresql(dot)org
Subject: Problems with HAVING
Date: 2005-01-12 16:38:51
Message-ID: 41E5529B.9030609@faith.digsys.bg
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hello,

My problem is that I want to select the row with max(date) but also
limited with where clauses.

Select
test.name
from
test
where
test.name = foo.name
having max(test.date)

This is a subquery and is part bigger query. How I can select the row
with the max query.

ERROR: argument of HAVING must be type boolean, not type date

This is the error I receive.
As far as I know I can't use agregate functions in where clause.

Thank you in advance.

Kaloyan Iliev

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Szűcs Gábor 2005-01-12 16:52:42 failed to find conversion function from "unknown" to text
Previous Message Andrew Hammond 2005-01-12 16:18:45 Re: Implementing queue semantics (novice)