Oracle中在pl/sql developer修改表的兩種語句
一、方式一select * from student for update
student表需要操作人修改完commit之後才可以做其他的操作,否則該表會被鎖住。二、方式二
select t.*,t.rowid from student t
在pl/sql developer中右擊某表,顯示的就是該語句,這樣做不會將該表鎖住。
想修改某幾個字段也沒有問題select num,name,t.rowid from student t。
該種方式也可以修改多表聯合查詢的情況,現有table1和table2兩張表,需要關聯查詢,需要修改的字段在table1中。
select t1.*,t1.rowid from table1 t1,table2 t2 where .......
要取得t1.rowid才可以進行修改。
最後更新:2017-04-03 22:30:57