SQL Having用法 --找出user_id重复的数据 SELECT MAX(id) AS max_id, user_id FROM tmp GROUP BY user_id HAVING COUNT(*) > 1