首页 > 代码库 > MAX()函数 group by

MAX()函数 group by

获取最后修改的记录

SELECT b.*
FROM
  (SELECT appli_no,
          max(revision_no) AS revision_no
   FROM TBAARS_COMMITTEE_APPLICATION
   GROUP BY appli_no) a
INNER JOIN TBAARS_COMMITTEE_APPLICATION b ON (a.appli_no= b.appli_no
                                              AND a.revision_no=b.revision_no)

MAX()函数 group by