7-数据库查询.pptVIP

  • 13
  • 0
  • 约9.59千字
  • 约 39页
  • 2017-06-03 发布于湖北
  • 举报
7-数据库查询要点

例: 查询与“刘晨”为同一个系的学生姓名(假如姓名允许重复)。 select sname from student where sdept in ( SELECT Sdept FROM Student WHERE Sname= 刘晨 ‘) 例: 查询与“刘晨”为同一个系、且年龄相同的学生姓名(假如姓名允许重复)。 [多行多列] sql server 中无法实现,oracle可以。 查询与“刘晨”为同一个系且年龄相同的学生姓名(假如姓名允许重复)。 select sname, sage, sdept from student where (sdept, sage) in ( SELECT Sdept ,sage FROM Student WHERE Sname= 刘晨 ‘) 在sql server中使用如下形式: SELECT sname FROM Student WHERE

文档评论(0)

1亿VIP精品文档

相关文档