开发者

What is POPULAR today when it comes to write SQL Queries: UPPER CASE or Lower Case? [closed]

开发者 https://www.devze.com 2023-03-15 19:39 出处:网络
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references,or expertise, but this question will likely solicit debate, a
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 11 years ago.

What is POPULAR today when it comes to write SQL Queries: UPPER CASE or Lower C开发者_JAVA技巧ase? And for what specific reason?

SELECT * FROM tMyTable 

Or

Select * from tMytable


Either. Just be consistent

Personally...

Keywords uppercase for me, objects and datatypes in Normal or CapsCase.

SELECT 
    M.Column1,
    CAST(O.Column2 AS int) AS IntColumn
FROM
    MyTable M
    JOIN
    OtherTable O ON M.SomeKey = O.SomeKey 
WHERE
    M.Column3 = 'bar'
ORDER BY
    M.Column1

It's easier to pick out the clauses of a complete SELECT query this way


As for me, it's a question of personal preferences. i prefer lower case. i don't like when sql-statements shout on me)


Case is not usually important within an SQL statement. Often people capitalise keywords just to make them stand out. IMHO, consistancy of choice just makes your code easier to read, although, I would rather have capitalised keywords, myself.

0

精彩评论

暂无评论...
验证码 换一张
取 消