2020年04月06日软件测试圈「每日进阶」
第10天作业 ,
-- 1) 找出istester表,sex为空的的数据;
select * from istester where sex is null
-- 2)更新istester表,把sex为空的,设置为0(性别未知)
update istester set sex=0 where id in (select id from istester where sex is null )---错误
update istester set sex = 0 where sex is null ;--√
-- 3)找出idoxu表,grade小于60分的同学
select * from idoxu where grade<60
-- 4)更新idoxu表,把grade小于60分的同学,一律改为59分
update idoxu set grade=59 where id in (select id from idoxu where grade<60)--错误
update idoxu set grade = 59 where grade < 60 ;---正确
空判断
is null
修改
格式:update 表名 set 列1=值1,列2=值2... where 条件
网友评论