日志正文
|
||
update语句
update语句语法: update {<table name|view name>} set {<column name>=<expression> [....,<last column name>=<last expression>] [where <search condition>] } 1、update语句更新列值 update tb_student12 set 学号=left(学号,2)+'1'+right(学号,4) where 专业名='计算机' 2、利用子查询更新多行的值 update tb_grade12 set 成绩=成绩+10 where 学号 in ( select 学号from tb_student12 where 专业名='计算机') and 课程号='01' 3、使用case表达式更新列值 update tb_case12 set 消费水平= case when 商品价钱>2000 then '昂贵' when (商品价格>=800) and (商品名称<=2000) then '一般' end 4、只更新存在于其它表中的数据 update tb_update12 set 浮动工资=200 where 职工姓名 in ( select 姓名 from tb_personnel12 ) |
||
评论 想第一时间抢沙发么?