PLSQL的常用基础SQL字段

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/ssxueyi/article/details/85127017

查询表

select * from MS_MATERIAL ;

删除表中所有的数据

delete from MS_MATERIAL;

新建临时表复制数据库中的表和表中数据

create table  temp as selectfrom  t_123;

更新表中字段:执行后点击开锁按钮就可以对某个字段的值进行更新

select * from MS_MATERIAL for update

 

把表1中的字段a值更新到表2的字段b中,两表的关联关系为字段3;

update 表2 m 
set 字段b =(select 字段a from 表1 where 字段3=m.字段3) 
where exists (select 字段a from 表1 where 字段3=m.字段3)

 

猜你喜欢

转载自blog.csdn.net/ssxueyi/article/details/85127017
今日推荐