mysql查询数据库重复数据(查重)

查询重复领取的优惠券

//查询8888888用户优惠券状态为未使用且数量大于2的用户领取过的优惠券
SELECT discount_coupon_id,count(discount_coupon_id) as c FROM `faith_user_discount_coupon` 
where user_id='88888888' and `status`='1' GROUP BY discount_coupon_id having c>1

 

posted @ 2023-07-20 14:40  白玉神驹  阅读(51)  评论(0)    收藏  举报