Figured out the query: select idx, vbs_id, date, weight from Weight,(select vbs_id as maxid, max(date) as maxdate from Weight group by vbs_id) as t
where vbs_id = maxid and date = maxdate;
It returns the proper weight and idx. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]