close
SELECT * FROM table as t1
left join table2 as t2
on t1.id = t2.t1_id
where t2.time = (SELECT max(time) from table2 as t22
where t22.t1_id=t1.id);
參考資料:
http://dev.mysql.com/doc/refman/5.7/en/example-maximum-column-group.html
文章標籤
全站熱搜