select a,b,... from a,b where a.id=b.id and a.id2||''||b.id2=
(select a.id2||''||b.id2 from a,b where a.id=b.id group by a.id2,b.id2 having(count(*))>1)
(select a.id2||''||b.id2 from a,b where a.id=b.id group by a.id2,b.id2 having(count(*))>1)
(select max(a.id2||''||b.id2) from a,b where a.id=b.id group by a.id2,b.id2 having(count(*))>1)
(select a.id2||''||b.id2 from a,b where a.id=b.id group by a.id2,b.id2 having(count(*))>1
and rownum='1')
(select a.id2||''||b.id2 from a,b where a.id=b.id group by a.id2,b.id2 having count(*)>1
and rownum<2)
select a,b,... from a,b where a.id=b.id and a.id2||''||b.id2=
(select a.id2||''||b.id2 from a,b where a.id=b.id and rownum<2group by a.id2,b.id2 having count(*)>1
)
select a,b,...
from a, b,
(select id from a group by id having count(*)>1
union
select id from b group by id having count(*)>1) c
where a.id=b.id
and a.id=c.id;
select a,b,...
from a, b,
(select a.id2||''||b.id2 ID2 from a,b
where a.id=b.id
group by a.id2,b.id2
having count(*)>1) c
where a.id=b.id
and a.id2||''||b.id2=c.id2;不过a.ID2||''||b.ID2与a.ID2||b.ID2是一样的。
select a,b,...
from a, b,
(select a.id2 aid2, b.id2 bID2 from a,b
where a.id=b.id
group by a.id2,b.id2
having count(*)>1) c
where a.id=b.id
and a.id2=c.aid2 and b.id2=c.bid2;