输入banner图图片脚本导航/分类

SqlSever基础 where is null 判断某个列的内容是否为null

--创建一个数据库 2 create database helloworld1 3 4 --用helloworld1这个数据库 5 use helloworld1 6 7 --创建一个表格teacher 8 create table Teacher 9 ( 10 Id int primary key identity(1,1), 11 Name nvarchar(10), 12 Class nchar(2) 13 ) 14 15 --看看 teacher这个表格有啥 16 select * from Teacher 17 18 --向这个表格中插入这几行内容 19 insert into Teacher 20 values(‘女娲娘娘‘,‘道家‘), 21 (‘元始天尊‘,‘道家‘), 22 (‘释迦摩尼佛‘,‘佛家‘), 23 (‘耶稣‘,‘基督‘), 24 (‘绿度母‘,‘佛家‘), 25 (‘九天应元雷声普化天尊‘,‘道家‘), 26 (‘无盐娘娘‘,‘道家‘), 27 (‘王母娘娘‘,‘道家‘) 28 29 --将teacher表中,Name为 绿度母的那一行,中的Class列的值 设置为 NULL 30 update Teacher set Class=null where Name=‘绿度母‘ 31 32 -- 显示teacher表中 class一列为NULL的行的所有内容 33 select * from Teacher 34 where Class is null

 

 

 

2 show

技术分享

 

 

 

 

——————————————————————————————————————————
博文的精髓,在技术部分,更在镇场一诗。
SqlSever是优秀的语言,值得努力学习。熟悉数据库的增删查改,写程序必备。
如果博文的内容有可以改进的地方,甚至有错误的地方,请留下评论,我一定努力改正,争取铸成一个良心博客。
注:此文仅作为科研学习,如果我无意中侵犯了您的权益,请务必及时告知,我会做出改正。

SqlSever基础 where is null 判断某个列的内容是否为null

标签:primary   where   code   判断   内容   博客   博文   div   key