SQL的IN, SOME,ANY,IN

表dbo.Student有12条数据

name

123123
123123
123123
123123
123123
123123
大雄1
阿华
浩然
菊花
大姐
123123

1.some,any用法一样(不知道有没有其他的不同)

select COUNT(*) from dbo.Student
where '123' = some(select Name from Student)

where 判断不含有等于'123'的字段,该条语句返回0.

2.all

select COUNT(*) from dbo.Student
where '123123' <> all(select Name from Student)

where判断123123不等于所有的Name,该条语句返回0.

3.In /NO IN

select COUNT(*) from dbo.Student
where '123' in (select Name from Student)

where 判断含有等于'123'的字段,该条语句返回0.

select COUNT(*) from dbo.Student
where '123' not in (select Name from Student)

where 判断不含有等于'123'的字段,该条语句返回0.

上一篇:JS创建一个数组1.求和 2.求平均值 3.最大值 4.最小值 5.数组逆序 6.数组去重 0.退出


下一篇:【转】Android-Input input&按键布局文件