数据库的表有4个字段
a1,a2,a3,a4
如何把表中a1,a2相等,但a4不相等的纪录找出来?
a1,a2,a3,a4
如何把表中a1,a2相等,但a4不相等的纪录找出来?
解决方案 »
- Oracle9i 没有备份,没有归档日志,数据丢失了,还能恢复吗?
- 怎样获取数据库各表之间的结构图?请教,谢谢
- 用exp导出数据库数据时提示“无法分配 131100 字节的共享内存。。。”
- 同为oracle 10G的字符集为Simplified Chinese_china zhs16gbk的库如何移殖入字符集为utf8的库中
- oracle8i 创建临时表
- 谁能给我一个ORACLE的标准存储过程示例,高分
- 各位我还有一个问题:如何在VB中用代码建立一个oracle数据源:在线等待!
- 帮帮忙,我都弄了一天了!现在还没吃饭!ODBC的问题!
- 请教oracle的一个奇怪问题:我的系统数据库在数据库服务器上可以顺利连接,但从客户端就怎么都连接不过去,提示无法处理服务名,我的这些
- 如何从ORACLE中倒出非缺省的XML文件
- 急:如何把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)