以下三个Select查询,无论Where子句在表别名和列名之间有多余空格,都会产生相同的结果。他们都有相同的执行计划。为什么空格的存在不会引发语法错误?
DECLARE @TblX TABLE(
ColX int
,ColY float
)
-----As it normally should be
SELECT *
FROM @TblX X
WHERE X.ColX = 1
----Even this works
SELECT *
FROM @TblX X
WHERE X .ColX = 1
----And this too
SELECT *
FROM @TblX X
WHERE X. ColX = 1