update一个表中的一个栏位 超过1000的数据乘以0.5 不足1000的乘以1.5 一个SQL执行,这个怎么写
顺便求一本SQL的学习书
------解决思路----------------------
update [表名]
set [字段名]=case when [字段名]>1000 then [字段名]*0.5
when [字段名]<1000 then [字段名]*1.5 end
------解决思路----------------------
update [Tablename]
set [colname]=case when [colname]>1000 then [colname]*0.5
when [colname]<1000 then [colname]*1.5 end
推荐一本书《microsoft sql server 2008技术内幕 t-sql语言基础 》