解决方案 »
- oracle行级锁问题
- oracleDBConsoleXXX和OracleServiceXXX启动特别慢,请教
- 数据库服务器间数据迁移中,包含CLOB字段的表更换表空间问题
- 求救:oracle10g 导入dmp文件问题
- 求助,各位高手解决下问题,关于System.InvalidOperationException: Timeout expired.
- 在SQL*PLUS里面执行以下语句,为什么不行呢?
- !!!郁闷了,又是一个连接QRACLE的问题!!!
- 在什么情况下oracle的collection.extend 不起作用
- 可以装ORACLE9i吗?
- pl/sql developer导入表时报“Error reading file”
- 求ORACLE高手,存储过程,字符变量类型长度不够
- 数据库全文检索方案
union
select * from A where flag=2 and id in('1','2');
union
select * from A where flag=2 and id in('1','2');最终要查出一条记录,您这个结果肯定是两条
union
select * from A where flag=2 and id in('1','2');最终要查出一条记录,您这个结果肯定是两条
那就是我理解错了你的问题了,其实你不妨可以简单的例举点数据和你想要的结果,这样更直观
union
select * from A where flag=2 and id in('1','2');最终要查出一条记录,您这个结果肯定是两条
那就是我理解错了你的问题了,其实你不妨可以简单的例举点数据和你想要的结果,这样更直观最后找到一种方法,是full join ,因为没有关联关系,所以用rownum做关联,大概就是 select rownum rn,* from A where flag=1and id in({list}) a
union
select rownum rn,* from A where flag=2 and id in({list}) b on a.rn=b.rn
union
select * from A where flag=2 and id in('1','2');最终要查出一条记录,您这个结果肯定是两条
那就是我理解错了你的问题了,其实你不妨可以简单的例举点数据和你想要的结果,这样更直观最后找到一种方法,是full join ,因为没有关联关系,所以用rownum做关联,大概就是 select rownum rn,* from A where flag=1and id in({list}) a
union
select rownum rn,* from A where flag=2 and id in({list}) b on a.rn=b.rnselect rownum rn,* from A where flag=1and id in({list}) a full join
select rownum rn,* from A where flag=2 and id in({list}) b on a.rn=b.rn