From: Sam Mason <sam@samason.me.uk>
To: pgsql-sql@postgresql.org
Subject: Re: Problems with HAVING
Date: Wed, 12 Jan 2005 17:40:19 +0000
Message-ID: <20050112174019.GS14073@sam.samason.me.uk> (raw)
In-Reply-To: <41E5529B.9030609@faith.digsys.bg>
References: <41E5529B.9030609@faith.digsys.bg>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: sam@samason.me.uk
Subject: Re: Problems with HAVING
In-Reply-To: <20050112174019.GS14073@sam.samason.me.uk>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox