vf第6章sql查询语言预览.ppt

4、确定集合 例12:从学生表中查询学号为”s0803001”、 ”s0803003”、 ”s0803004”的学生信息。 select * from 学生 where 学号 in( ”s0803001”, ”s0803003”, ”s0803004” ) 例13:从学生表中查询学号不为”s0803001”、 ”s0803003”、 ”s0803004”的学生信息。 select * from 学生 where 学号not in( ”s0803001”, ”s0803003”, ”s0803004” ) 5、部分匹配查询 %表示任意长度的字符串 _表示任意一个字符 例14:从学生表中查询所有姓张的同学信息。 select * from 学生 where 姓名 like “张%” 例15:从学生表中查询名字第二个字为“小”的同学信息 select * from 学生 where 姓名 like “_小%” 6、空值查询 使用 is null 或者 is not null来查询某个字段的值是否为空值 例16:从学生表中查询姓名不为空值的记录。 select * from 学生 where 姓名 is not null 四、统计查询 求一列中的最小值

文档评论(0)

1亿VIP精品文档

相关文档