如何正确使用嵌套子查询的SQL语句?
- 内容介绍
- 文章标签
- 相关推荐
本文共计186个文字,预计阅读时间需要1分钟。
注意:当没有使用 EXISTS 引入子查询时,可能会出现 eg 错误。示例:
select (select A, B, C from D where E) from Student where Sname='Mimo_YY'---- select (select A, B, C from D where E) from Student where Sname='Mimo_YY'
注意当没有用exists引入子查询时eg错误示例select(selectA,B,CfromDwhereE)fromStudentwhere注意当没有用exists引入子查询时
eg 错误示例select (select A,B,C from D where E)from Studentwhere SnameMimo_YY----select (select A,B,C from D where E)----在子句() 里的语句 错了只能select 一个字段但是这里select了A,B,C三个字段
eg 正确示例select (select A from D where E)from Studentwhere SnameMimo_YY----select (select A from D where E)----在子句() 里的语句 正确只能select 一个字段
select 套子句时子句只能 select 一个字段
本文共计186个文字,预计阅读时间需要1分钟。
注意:当没有使用 EXISTS 引入子查询时,可能会出现 eg 错误。示例:
select (select A, B, C from D where E) from Student where Sname='Mimo_YY'---- select (select A, B, C from D where E) from Student where Sname='Mimo_YY'
注意当没有用exists引入子查询时eg错误示例select(selectA,B,CfromDwhereE)fromStudentwhere注意当没有用exists引入子查询时
eg 错误示例select (select A,B,C from D where E)from Studentwhere SnameMimo_YY----select (select A,B,C from D where E)----在子句() 里的语句 错了只能select 一个字段但是这里select了A,B,C三个字段
eg 正确示例select (select A from D where E)from Studentwhere SnameMimo_YY----select (select A from D where E)----在子句() 里的语句 正确只能select 一个字段
select 套子句时子句只能 select 一个字段

