Oracle重复行查询实例教程
程序员文章站
2022-04-14 10:28:58
oracle重复行查询实例教程
create table dlp_test (a number(2),b number(2));
insert into dlp_test values(...
oracle重复行查询实例教程
create table dlp_test (a number(2),b number(2)); insert into dlp_test values(1,2); insert into dlp_test values(1,2); insert into dlp_test values(3,4); insert into dlp_test values(5,6); insert into dlp_test values(3,5); insert into dlp_test values(3,5);
select * from dlp_test ;
--获取不重复行 select distinct x.* from dlp_test x; --获取仅出现一次的行 --① select a.* from dlp_test a, (select a, b from dlp_test group by a, b having count(*) = 1) b where a.a = b.a and a.b = b.b; --② select * from dlp_test where rowid in (select rowid from (select a, b, count(*) over(partition by a, b) t from dlp_test) where t = 1);
上一篇: Asp.net mvc 数据访问层详情
下一篇: SGML/HTML/XML之间的关系详情