我想找出某个列只包含一个空格而不包含任何其他内容的记录.所以我编写了以下第一个查询:
select COUNT(*)
from mytable
where col = ' ' -- One space
select COUNT(*)
from mytable
where col = ' ' -- Two spaces
select COUNT(*)
from mytable
where col = ' ' -- Three spaces
Run Code Online (Sandbox Code Playgroud)
但是,所有三个查询都返回完全相同的记录.Microsoft SQL Server无法区分空间量吗?如何准确查询一个,两个或更多空格?