Tibby wrote:

..and I want to get this with a single query:

+-----+--------+------+
| key  | desc    | value |
+-----+--------+------+
|   2   | book    |       7 |
|   6   | pen     |       7 |
+-----+--------+------+

I need to get only one row from col. DESC, the one with the highest VALUE.
With one query...


select `desc`, max(value) from mytable
group by `desc`





--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to