What is POPULAR today when it comes to write SQL Queries: UPPER CASE or Lower Case? [closed]
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.
精彩评论