SELECT
a.repayDate
FROM
t_jt_contract_data AS t
LEFT JOIN (SELECT contractId, MAX(id) AS maxId FROM t_jt_contract_fund_ransom_apply GROUP BY contractId) AS c ON t.id = c.contractId
LEFT JOIN t_jt_contract_fund_ransom_apply a ON c.maxId = a.id
WHERE
t.insertFlag = 2
MySql语句_取重复记录中最新的一条
于 2017-12-13 10:34:05 首次发布