Re: [SQL ]MAX()其他相依的欄位資料

看板Database作者 (炸炸炸~彈)時間12年前 (2013/04/21 22:21), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串3/3 (看更多)
※ 引述《folus (folus)》之銘言: : 請教各位高手: : 我目前遇到一個問題,直接看 SQL 吧 : select id,max(value) from table group by id : table 欄位共有 id,value,date,note : 我要如何查詢相依於結果 id,max(value)的其他欄位呢? : 感謝高手協助 oracle 的語法可以參考, 不知道是不是你要的結果! select id, value, date, note from table where id || value in ( select id || max(value) from table group by id ) -- Sent from my Android -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.25.203.155
文章代碼(AID): #1HS_O6hp (Database)
文章代碼(AID): #1HS_O6hp (Database)