> preface: have RTM on mysql GROUP BY > > I have a mysql db with a number of entries... > table| id | name | info | version > 1 x foo 1 > 2 x foob 2 > 3 x foobar 3 > > my sql is similar to > "select id,name,info from table GROUP BY name order by name,version > desc" > > in an effort to only return one result of type (x), but get the most > recent info (foobar) and version (3), however this isn't the case. > GROUP BY returns the first info and version it comes across. > > Has anyone run across this issue, or know of a solution? Thanks.
Not sure what this has to do with PHP, but... I know you RTM, but here's a link from it you probably haven't read that should solve your problem: http://www.mysql.com/doc/en/example-Maximum-column-group-row.html ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php