我想做查询操作的时候就把查询出的记录锁住,不允许对这些行做其它操作,怎么实现?

解决方案 »

  1.   

    加上for update 就可以了,如:
    select * from table for update
      

  2.   

    行级锁
    select * from tbname where ... for update;
      

  3.   

    select * from 表 for update
      

  4.   

    select * from 表 for update
      

  5.   

    select * from 表 for update where recordID=ID 的用法是:当一个客户段执行了这条语句,在修改这条语句之前,其他客户端如果也执行select * from 表 for update where recordID=ID是查不出东西的,所以可以起到锁定的作用,怎样实现由你的具体业务需求而定