摘要:[SQL]TABLE資料表中有雙PK(兩個欄位是主鍵KEY,一個自動遞增),取得遞增的欄位MAX的資料
SELECT his.app_no,his.app_pds_reason,his.seq_no FROM pds_appeal_history his
WHERE his.seq_no =
(SELECT MAX(his1.seq_no) from pds_appeal_history his1
WHERE his1.app_no = his.app_no)
order by app_no,his.seq_no