为什么在SQL Server中我不能这样做:
select sum(count(id)) as 'count'
from table
Run Code Online (Sandbox Code Playgroud)
但我能做到
select sum(x.count)
from
(
select count(id) as 'count'
from table
) x
Run Code Online (Sandbox Code Playgroud)
它们本质上不是一回事吗?为了理解为什么不允许第一块代码,为什么我要考虑这个?