第1个回答 2008-12-21
update 表名字 set d= case when c>30 then (c-30)*0.8 else 0 end
第2个回答 推荐于2018-05-09
select *,(case when c>=30 then (C-30)*0.8 else 0 end) as E into table_name_bak from table_name
上面的语句table_name为你的表名,功能是能够新建个table_name_bak 的表 这个表新曾了列E ,列E 的数据为 (C-30)*0.8 ,如果C小于30则为0
----------------
一般不建议更改基本表,但可以建个视图,例如:
create view view_表名
as select C ,(case when c>=30 then (C-30)*0.8 else 0 end) as D from 表名
将表名改成你的基础表名,就是可以使用了!本回答被提问者和网友采纳
第3个回答 2008-12-29
回答者: Sharon_QQ - 高级经理 六级 12-23 15:15
正解!
第4个回答 2008-12-21
select (case when c>=30 then (C-30)*0.8 else 0 end) as d from table_name