Hi there,

I'm using MySQL 4.0.15 on RedHat 9.0.

I've got problem for which I can't figure out how to do it efficiently
without using a subquery.  4.1.0 isn't really an option since this is going
into a stable environment.

The table is like this.

+----------+------+--------+
| revision | id   | name   |
+----------+------+--------+
|        4 |   80 | filea  |
|        5 |   85 | filea  |
|        8 |   77 | fileb  |
|        9 |   73 | filec  |
+----------+------+--------+

I want to group by name, and get the id of the highest revision for each
file.  So the query should return the following results:

+------+
| id   |
+------+
|   85 |
|   77 |
|   73 |
+------+

Is there any way of doing this efficiently without needing a subquery and
upgrade to MySQL 4.1.0?

Thanks,

Mike




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

Reply via email to