数据库指定时间内重复数据查询
-- 查询重复数据
select qr_code,created_at,station_by from t_product_data where flag = 0 and qr_code in(
select qr_code from t_product_data t
where flag = 0
-- 时间不唯一并且码数据一致的情况 说明是重复数据
and t.created_at not in(
select MAX(created_at)from t_product_data tt where tt.qr_code = t.qr_code and flag =0
)
)
order by qr_code

浙公网安备 33010602011771号