关于排除null空值的查询?
成绩表
学号        课程      成绩    备注
0001      计算机    80     补考
0002      物理      90     2006年补考
0003      软件工程  70     null
0004      c语言     60     null
要求:查询出备注不包含  补考 的成绩?
(select * from 成绩表 where 备注 not like '%补考%' 这样查询不出来)
一般这种包含null空值的字段,使用不包含 某值  查询是通过什么方法啊?
------解决方案--------------------where isnull(备注,'') not like '%补考%'
或者
where 备注 not like  '%补考% ' or 备注 is null
------解决方案--------------------[code=SQL][/code]
select * from 成绩表 where charindex('补考', 备注)=0 or (备注 is null)
------解决方案--------------------用isnull函数