不多说,直接上解决方法
SELECT
*
FROM
(
SELECT
tb.*,
bpm.CREATE_DATE_
FROM
w_jzgyqjktb tb
LEFT JOIN bpm_bus_link bpm ON bpm.BUSINESSKEY_STR_ = tb.ID_
WHERE
bpm.CREATE_DATE_ <= date_sub( curdate( ), INTERVAL 0 DAY )
ORDER BY
bpm.CREATE_DATE_ DESC
) AS v
GROUP BY
v.F_gh
原本这样,排序没生效,子查询中加limit后生效
SELECT
*
FROM
(
SELECT
tb.*,
bpm.CREATE_DATE_
FROM
w_jzgyqjktb tb
LEFT JOIN bpm_bus_link bpm ON bpm.BUSINESSKEY_STR_ = tb.ID_
WHERE
bpm.CREATE_DATE_ <= date_sub( curdate( ), INTERVAL 0 DAY )
ORDER BY
bpm.CREATE_DATE_ DESC
limit 1000000000000000
) AS v
GROUP BY
v.F_gh
解决。