Mysql多个条件查询去重数据
程序员文章站
2022-03-11 18:41:11
...
mysql查询多个条件去重
SELECT * FROM tb_user_customer a WHERE CONCAT(agent_id, '-', client_id) IN
(
SELECT CONCAT(agent_id, '-', client_id) AS ACID
FROM tb_user_customer
GROUP BY ACID HAVING COUNT(ACID) > 1
);