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)
解决方案 »
- 物化视图刷新的时候如何不产生归档日志?
- 悲哀呀,数据表删不了?
- 求虚拟机linux下手动(非dbca)安装oracle的详细文档。
- 问一个关于可变条件SQL检索的问题
- VB连接Oracle出现错误“Error while trying to retrieve text for error ORA-12154”
- 怎样建立一个自动删除的触发器
- 怎样能最快得把WINDOWS下的数据库拷贝到UNIX下,请高手指点!
- 请教如何提高如下的查询速度
- 关于创建数据库的问题?
- rman恢复为什么不能恢复被delete的数据?
- oracle 有没有bulk insert语句啊 ?
- 在线等待!!!!一个job问题===做不出来我就失业了!!!!帮帮我!!!!
(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;