首页 > 数据库

For Update 与 For Update of 区别

时间:2009-04-24 13:26:52  作者:张飞  我要投稿
Linux初探欢迎您的投稿,投放方法请点击这里查看,我们会定期赠送精美小礼品给优秀的投稿作者。海纳百川 取则行远!LinuxGoo欢迎您的到来。
1 :select * from TTable1 for update 锁定表的所有行,只能读不能写 2 :select * from TTable1 where pkid = 1 for update 只锁定pkid=1的行 3 :select* from Ta......

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中满足条件的行

如果您需转载 For Update 与 For Update of 区别,请注明来自LinuxGoo.com,其版权归原作者所有。请广大网友留言时遵纪守法,使用文明用语。如果您在应用中有什么问题,请在下面留言,我们会尽快解答。
来顶一下
近回首页
返回首页
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表
相关文章
栏目热门