MySQL Forums
Forum List  »  Newbie

Having - Newest date
Posted by: Fionn MacHugh
Date: August 09, 2005 05:59AM

Hi there folks,

Just a quick one - i have a having (if one can...)
where i need the row with the newest date only returned (or if they are all the same then just one row)

my result at the mo is

ref CNT startdate title
363 3 1/10/2005 Liz
646 3 3/6/2005 Liz
1234 3 4/4/2004 Liz
321 3 2/2/2005 john
222 3 2/2/2005 john
109 3 2/2/2005 john

my HAVING clause is like this

HAVING (CNT = 3 and ....???? (tried MAX(startdate) but that dont do it!)

my output need

363 3 1/10/2005 Liz
and just one of the the john lines as they are all the same date...

any ideas gurus?
muchos gracias en advance!

Options: ReplyQuote


Subject
Written By
Posted
Having - Newest date
August 09, 2005 05:59AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.