oracle中怎么提取重复的数据。

2025-03-17 03:29:39
推荐回答(3个)
回答1:

使用group by 分组,语句如下:
select prod_id,fea_spec_id from prod_fea where prod_id=2012 group by prod_id,fea_spec_id having count(fea_spec_id) = 2

回答2:

select top(*)1 from prod_fea where prod_id=2012 order by modify_date desc

回答3:

select prod_id,fea_spec_id,min(prod_id),count(*) from prod_fea where prod_id=2012 group by prod_id,fea_spec_id having count(*) >1