与此Find duplicate records in MySQL类似,我希望根据特定列的值提取MySQL数据库中的重复记录。要取出ID最高的那个,我可以这样做: SELECT MAX(id), name, address, no_purchase, count(id) as cnt FROM list
GROUP BY name, address HAVING cnt > 1 要取出ID最小的那个,我可以这样做: SELECT MIN(id), name, address, no_purchase