ITeye博客

ORACLE update for

winzenghua · 2009-03-06 16:34 · Markdown

1

select * from TTable1 for update

锁定表的所有行,只能读不能写

2

select * from TTable1 where pkid = 1 for update

只锁定pkid=1的行

3

select * from Table1 a join Table2 b on a.pkid=b.pkid for update

锁定两个表的所有记录

4

select * from Table1 a join Table2 b on a.pkid=b.pkid where a.pkid = 10 for update

锁定两个表的中满足条件的行

5.

select * from Table1 a join Table2 b on a.pkid=b.pkid where a.pkid = 10 for update of a.pkid

只锁定Table1中满足条件的行

6 select job from emp where job='clerk' for update of empno;

又是什么意思呢?

我猜是锁定 job='clerk' 这些数据 EmpNo 又干嘛的呢?

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。