注意当没有用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)
----在子句() 里的语句 错了,只能select 一个字段,但是这里select了A,B,C三个字段
eg 正确示例:
select (select A from D where E)
from Student
where Sname='Mimo_YY'
----select (select A from D where E)
----在子句() 里的语句 正确,只能select 一个字段
select 套子句时,子句只能 select 一个字段
本文介绍了在SQL中使用子查询时的正确语法规范。强调了在嵌套查询中,子查询部分仅能选择单个字段的重要性,并通过示例对比了正确的子查询写法与错误的写法。
984

被折叠的 条评论
为什么被折叠?



