查询表中重复字段数据的id

select id_,price_ from ap_car a where open_ = 1 and exists(
select 1 from ap_car where a.price_=price_
group by price_ having count(*)>1 and min(id_)<a.id_
) order by price_ desc;

猜你喜欢

转载自peng13123.iteye.com/blog/2046118