目前分類:mysql (2)

瀏覽方式: 標題列表 簡短摘要
  • 這是一篇加密文章,請輸入密碼
  • 密碼提示:cc
  • 請輸入密碼:

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

文章標籤

kkkelu1008 發表在 痞客邦 留言(0) 人氣()