MSSQL Server常用知识总结

来源:互联网 发布:淘宝申请介入有用吗 编辑:程序博客网 时间:2024/06/11 01:45

1、去除表中某个字段对应的值中的空格??

update ST_PPTN_D set STNM=REPLACE(STNM,' ', '');

 


2、根据一个表中筛选出来的字段去更新另一个表中的某个对应字段??

update ST_RSVR_Dset ST_RSVR_D.LGTD=tt.LGTD,ST_RSVR_D.LTTD=tt.LTTDfrom (   select 水位站编码,LGTD,LTTD from 水位站 where    LGTD is not null and LTTD is not null and LGTD<>'' and LTTD<>'' and     slasttime is not null and slasttime>'2012-01-01') ttwhere ST_RSVR_D.STCD=tt.水位站编码


 

 

原创粉丝点击