pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kaloyan Iliev Iliev <news1@faith.digsys.bg>
To: Sam Mason <sam@samason.me.uk>
Cc: pgsql-sql@postgresql.org
Subject: Re: Problems with HAVING
Date: Wed, 12 Jan 2005 20:39:17 +0200
Message-ID: <41E56ED5.8040005@faith.digsys.bg> (raw)
In-Reply-To: <20050112174019.GS14073@sam.samason.me.uk>
References: <41E5529B.9030609@faith.digsys.bg>
	<20050112174019.GS14073@sam.samason.me.uk>

Thanks for the replay first.

Yes I use "having" like I have written. I can't use your query because 
in subquery I must write again the whole WHERE clause.
But in the other mail in the tread there is the solution:)

Thanks again

Kaloyan

Sam Mason wrote:

>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
>
>---------------------------(end of broadcast)---------------------------
>TIP 2: you can get off all lists at once with the unregister command
>    (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>
>
>  
>



view thread (6+ messages)  latest in thread

Message-ID: <41E56ED5.8040005@faith.digsys.bg>
Permalink:  ../41E56ED5.8040005@faith.digsys.bg/
Also on:    postgresql.org/message-id/41E56ED5.8040005@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, sam@samason.me.uk
  Subject: Re: Problems with HAVING
  In-Reply-To: <41E56ED5.8040005@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