在web_hk_roadway数据表中根据ROADWAY_CODE查询ROADWAY_NAME得时候发现一个code查询出来了多条name,因此决定首先对数据表中ROADWAY_CODE和ROADWAY_NAME一致的数据进行去重处理,下面是去重成功的语句
DELETE
FROM
web_hk_roadway
WHERE
ID NOT IN ( SELECT t.max_id FROM ( SELECT max( ID ) AS max_id FROM web_hk_roadway GROUP BY ROADWAY_CODE, ROADWAY_NAME ) AS t );