日期:2014-05-17  浏览次数:20872 次

急求oracle查询重复值sql语句
表中有一个字段是存储如 "1,15,89,1245 "内容的,想查询有重复值的记录如 "45,56,789,789 "中 "789 "是重复,谢谢

------解决方案--------------------
select a.* from table a,table b where a.column=b.column and a.rowid <> b.rowid
------解决方案--------------------
select a.* from table_a a where a.column not in (select b.column from table_b b where a.column <> b.column);
------解决方案--------------------

表Test中有字段a 有重复的记录。

select distinct(a), count(a)
from test
where a in
(select distinct(a) from test)
group by a;

可查出字段a ,以及它在表test中有多少重复的记录!