如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中如何實現呢,想了很久了,請高手幫助,謝謝
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'
)