可能重复:
是否有充分的理由对T-SQL关键字使用大写?
简单的问题.我个人发现一串小写字符比一串大写字符更易读.是一些旧的/流行的SQL味道敏感或什么?
以供参考:
select
this.Column1,
case when this.Column2 is null then 0 else this.Column2 end
from dbo.SomeTable this
inner join dbo.AnotherTable another on this.id = another.id
where
this.Price > 100
Run Code Online (Sandbox Code Playgroud)
与
SELECT
this.Column1,
CASE WHEN this.Column2 IS NULL THEN 0 ELSE this.Column2 END
FROM dbo.SomeTable this
INNER JOIN dbo.AnotherTable another ON this.id = another.id
WHERE
this.Price > 100
Run Code Online (Sandbox Code Playgroud)
前者对我来说似乎更具可读性,但我更经常地看到后一种方式.