mysql查询某条数据出现两次以上

白玉神驹 / 2023-05-06 / 原文

查询order_id重复出现两次以上

select order_id  from t_test  where 1=1 GROUP BY order_id  HAVING count(order_id  ) > 1;

查询order_id,phone重复出现两次以上

select *  from t_test  where 1=1 GROUP BY order_id,phone HAVING count(order_id+phone ) > 1;