sql:distinct
SELECT COUNT(name) AS num,name FROM xd_auto_category where level=2 and typename="rank" GROUP BY name having(num)>1 ORDER BY num DESC