数据库的表有4个字段
a1,a2,a3,a4
如何把表中a1,a2相等,但a4不相等的纪录找出来?
a1,a2,a3,a4
如何把表中a1,a2相等,但a4不相等的纪录找出来?
解决方案 »
- 关于ORA-39082。请问谁有metalink账号,能否帮我查下这个错误:Doc ID:460267.1
- rman 的全备份问题
- oracle的连接问题,求各位大大帮忙解决
- ora-12571 错误
- 怎么删除或压缩UNDOTBS表空间的数据文件
- 自定义函数在SQL中返回的结果竟然会变化,紧急SOS!
- 在启动Oracle9时,读的哪个初始化参数文件???
- 请教大家Oracle8i安装出错怎麽解决!!!
- 连接已关闭是怎么会事
- create session 与 create table 权限之间的关系问题
- 急:如何把oracle中的blob转为本地的jpg文件,请求存储过程,望详细。解决立即送分!
- 将一个表分为多段
2 select a,b,c,d,decode(a,b,decode(a,d,1,0),0) f from test)
3* where f=1
SQL> / A B C D
---------- ---------- ---------- ----------
1 1 4 1SQL> select * from test; A B C D
---------- ---------- ---------- ----------
1 1 3 2
1 1 4 1
1 2 4 1
select a1,a2,a3,a4,decode(a1,a2,decode(a1,a4,0,1),0) b from test)
where b=1;
from table1 a
where exists (select 1
from table1 b
where a.a1 = b.a1
and a.a2 = b.a2
and a.rowid != b.rowid
and a.a4 != b.a4)
from table t1,table t2
where t1.a1=t2.a1
and t1.a2=t2.a2
and t1.a4<>t2.a4
select a.a1,a.a2,a.a3,a.a4 from table a
where (a.a1=a.a2
and a.a1<>a.a4)
or (a.a2<>a.a4 and a.a1=a.a2)