C,

> After some struggling, I have managed to get the problem below 99% working,
> the problem now is that I can't get them in descending order. Here is my
> select statement.
>    $query = "select manager.name, position, MAX(goals) from roster join
> reference join manager where
>    manager.idn=reference.idn and reference.idp=roster.idp and position like
> 'F'
>    GROUP BY manager.name order by goals desc";
> Using the example below, this is what I get:
> Bill     70
> John   48
> Fred   87
> This is what I want:
> Fred   87
> Bill     70
> John   48

As an extension to ANSI-SQL, MySQL has added ASC/DESC to GROUP BY. So
might want to try GROUP BY manager.name DESC.

Regards,
--
  Stefan Hinz <[EMAIL PROTECTED]>
  iConnect GmbH <http://iConnect.de>
  Heesestr. 6, 12169 Berlin (Germany)
  Telefon: +49 30 7970948-0  Fax: +49 30 7970948-3


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to