MySQL Forums
Forum List  »  Newbie

Re: MAX() and GROUP BY Problems...
Posted by: Chris Stubben
Date: April 27, 2005 09:44AM

Hi,

The first example (using the aggregate function) will only work in a HAVING clause, not an ORDER BY. Sorry.
The 2nd and 3rd examples will work.

Chris

>
> SELECT MAX(Date) as max_date, MAX(Time), UserName
> FROM radius_accounting GROUP BY UserName ORDER BY
> max_date desc;
>
> or
>
> SELECT MAX(Date), MAX(Time), UserName FROM
> radius_accounting GROUP BY UserName ORDER BY 1
> desc;
>

Options: ReplyQuote


Subject
Written By
Posted
Re: MAX() and GROUP BY Problems...
April 27, 2005 09:44AM


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.