17,086
社区成员
发帖
与我相关
我的任务
分享
create table Tab1 as
(
select '01' a,'2000-12-12' b,'1a' c,'1b' d from dual union
select '01','2000-12-12','1b','1c' from dual union
select '01','2000-2-1','1a','1b' from dual union
select '02','2000-1-5','2b','2b' from dual union
select '02','2000-4-1','2a','2b' from dual union
select '03','2000-12-12','3a','1b' from dual union
select '03','2000-6-9','3a','1b' from dual union
select '03','2000-2-10','3a','3b' from dual
);
select distinct t1.* from tab1 t1,tab1 t2
where t1.b <> t2.b and t1.a=t2.a and (t1.c <> t2.c or t1.d <> t2.d)
order by t1.a ,t1.b;