What SQL coding standard do you follow? [closed]

2019-01-12 17:57发布

Is there any widely used SQL coding standard out there? SQL is little bit different from C/C++ type of programming languages. Really don't know how to best format it for readability.

14条回答
狗以群分
2楼-- · 2019-01-12 18:28

I generally keep very little per line, ie:

select
    col1,
    col2,
    col3
from
    some_table tabl1
where
    col1 = 'some'
and 
(
    col2 = 'condition'
or  col2 = 'other'
)
查看更多
来,给爷笑一个
3楼-- · 2019-01-12 18:30

If you google, there are plenty of coding standards out there. For example,

Database Coding Standard and Guideline

and

SQL SERVER Database Coding Standards and Guidelines Complete List

查看更多
登录 后发表回答