如SQL Server 2000中可以這樣實現更新或刪除記錄
update t1 from t1 a,t2 b
set a.fd = 1 where a.id = b.id and b.fd2 = 'a' and b.fd3 = 'b' and b.fd4 = 'c' delete t1 from t1 a,t2 b
where a.id = b.id and b.fd2 = 'a' and b.fd3 = 'b' and b.fd4 = 'c' 以上兩句在Oracle中如何實現呢,想了很久了,請高手幫助,謝謝
update t1 from t1 a,t2 b
set a.fd = 1 where a.id = b.id and b.fd2 = 'a' and b.fd3 = 'b' and b.fd4 = 'c' delete t1 from t1 a,t2 b
where a.id = b.id and b.fd2 = 'a' and b.fd3 = 'b' and b.fd4 = 'c' 以上兩句在Oracle中如何實現呢,想了很久了,請高手幫助,謝謝
解决方案 »
- 关于SQL语句
- 时间汇总问题,请帮忙看下
- oracle中,设定varchar2长度为4000,(最大只能存4000),为什么存到1333就不行了,多一个都不行,报 ORA-01480:trailling
- ORACLE初级资料
- oracle 9i 数据链接 sql server 报ora-28545 错误,是否跟NTFS有关
- (30分)问一个关于SQL取名的问题!
- 表分区高手请进
- 请教一存储过程
- oracle US7ASCII字符集数据导入ZHS16GBK问题
- 我在Oracle9i中配置监听程序TNSLSNR.exe出现错误
- 如何删除一个数据库实例?都是有那些方法?数据库的数据文件已经被删除了,在线等!
- 请问这错在什么地方?大哥再给我看看
where t1.id
in( select b.id from t1 a, t2 b
where
b.id = a.id and
b.fd2 = 'a' and
b.fd3 = 'b' and
b.fd4 = 'c' )
delete t1 from t1 a,(Select a.id1,b.id2,c.id3
from a,b,c where a.id = b.id and b.id2 = c.id2) b
where a.id1 = b.id1 and a.id2 = b.id2 and a.id3 = b.id3
and b.fd2 = 'a' and b.fd3 = 'b' and b.fd4 = 'c'
delete t1 from t1 a,(Select a.id1,b.id2
from a,b,c where a.id = b.id and b.id2 = c.id2
where b.fd2 = 'a' and b.fd3 = 'b' and b.fd4 = 'c'
) b
where a.id1 = b.id1 and a.id2 = b.id2 and a.id3 = b.id3
delete t1 from t1 a,t2 b
where a.fd1 = b.fd1 and a.fd2 = b.fd2 and b.fd3 = 'abc'
where exists (select 1 from t2 b where a.fd1 = b.fd1 and a.fd2 = b.fd2 and b.fd3 = 'abc'
)