如何停止显示来自 mysql 的记录的冗余

How to stop Redundancy in Displaying record from mysql

我遇到了来自 mysql 的冗余记录问题,如何在这个特定查询中避免这种情况?

$sql = "SELECT  DISTINCT d.*,m.* 
        FROM df_job_meta m 
        LEFT OUTER JOIN df_job_post d ON d.ID = m.JOB_ID 
        WHERE (d.STATUS =:ACTIVE) 
        and ( m.VALUE LIKE :wha ) 
        and d.STATE LIKE :whe 
        order by d.ID DESC";

只需添加 ... GROUP BY d.ID 即可删除重复的 ID