MySql语句_取重复记录中最新的一条

来源:互联网 发布:西安亿才软件 编辑:程序博客网 时间:2024/06/14 19:27
SELECT    a.repayDateFROM    t_jt_contract_data AS tLEFT JOIN (SELECT contractId, MAX(id) AS maxId FROM t_jt_contract_fund_ransom_apply GROUP BY contractId) AS c ON t.id = c.contractIdLEFT JOIN t_jt_contract_fund_ransom_apply a ON c.maxId = a.idWHERE    t.insertFlag = 2
阅读全文
0 0