Oracle分組查詢後,獲取最大值的記錄

最近在寫個分組查詢獲取最新時間戳的語句時,發現這樣寫挺受用的,分享之:sql   select * from test a where a.updatetime=(select max(b.updatetime) from test b where a.type=b.type)   ps:假設a是已經groupby以後的表。code
相關文章
相關標籤/搜索