Re: Problems with HAVING

From: Sam Mason <sam(at)samason(dot)me(dot)uk>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Problems with HAVING
Date: 2005-01-12 17:40:19
Message-ID: 20050112174019.GS14073@sam.samason.me.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Kaloyan Iliev Iliev wrote:
>select test.name
>from test
>where test.name = foo.name
>having max(test.date)

I don't think you use the "having" clause like you've done there. I
think you want to be doing something more like:

select test.name
from test
where test.name = foo.name
and test.date in (select max(date) from test);

But I may have misinterpreted you. . .

Cheers,
Sam

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Michael Fuhr 2005-01-12 17:41:30 Re: Problems with HAVING
Previous Message Andrew Sullivan 2005-01-12 17:23:28 Re: failed to find conversion function from "unknown" to text