集合查询
来源:互联网 发布:程序编程入门书籍推荐 编辑:程序博客网 时间:2024/05/24 15:41
集合查询
例题48
查询计算机专业的学生和年龄不大于19岁的学生 union
select * from tab_Student
where Sdept='CS'
union
select * from tab_Student
where Sage<=19
例题49
查询选修了课程1或者选修了课程2的学生信息 union
select * from tab_Student
where exists (select * from tab_SC where Sno=tab_Student.Sno and Cno=1)
union
select * from tab_Student
where exists (select * from tab_SC where Sno=tab_Student.Sno and Cno=2)
例题50
查询计算机系的同学和年龄不大于19的学生的交集 intersect
select * from tab_Student
where Sdept='CS'
intersect
select * from tab_Student
where Sage<=19
实际上上面那句等同于
select * from tab_Student
where Sdept='CS' and Sage<=19
- 集合查询
- 子查询、集合查询
- 连接查询和集合查询
- 数据库 - 连接查询、嵌套查询、集合查询
- 重复查询集合
- SQL集合查询
- SQL 查询集合
- oracle集合查询
- oracle之集合查询
- thinkphp查询集合
- LINQ - 查询对象集合
- mongodb 集合查询$in
- Oracle_集合运算查询
- oracle集合查询
- oracle集合查询
- mysql 面向集合查询
- MySql集合查询
- 分页、集合查询
- 字符集本地化(locale)与输入法系列讲座-----(6) ubuntu9.04下安装scim 及英文下激活scim
- 什么是IDS?
- 找工作
- 提升JSP应用程序的七大绝招(转)
- 存储控制
- 集合查询
- 视图
- encodeURIComponent编码 URLDecoder.decode解码乱码的问题
- 数据更新
- 游戏引擎
- dbm数据库源代码分析(2):构建性文件
- IBM 测试工具相关
- SQL 脚本三
- 键盘上所有快捷键