pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kaloyan Iliev Iliev <news1@faith.digsys.bg>
To: pgsql-sql@postgresql.org
Subject: Problems with HAVING
Date: Wed, 12 Jan 2005 18:38:51 +0200
Message-ID: <41E5529B.9030609@faith.digsys.bg> (raw)

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

view thread (6+ messages)  latest in thread

Message-ID: <41E5529B.9030609@faith.digsys.bg>
Permalink:  ../41E5529B.9030609@faith.digsys.bg/
Also on:    postgresql.org/message-id/41E5529B.9030609@faith.digsys.bg

 · 

reply

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: news1@faith.digsys.bg
  Subject: Re: Problems with HAVING
  In-Reply-To: <41E5529B.9030609@faith.digsys.bg>

* 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