SQL: Ignore alignment for 1=1 or 1=2 in WHERE Clause

1 Posts
1 Users
0 Likes
186 Views
(@chris_m)
Member
Joined: 2 years ago
Posts: 5
Topic starter  

I would like to have configure that the 1=1 or 1=2 statements (used for formatting reasons) in the WHERE-statements are not aligned when the rest of the where clauses are aligned. Those formatting statements help in that the first (or last) line in the clause can easily be commented without having an error, and the code is better readable.

Example:

select attr1
from table1
where 1=1
      and attr2     = 5
      and attr_name = 7;

select attr1
from table1
where 1=2
       or attr2     = 5
       or attr_name = 7;

   
Quote
Topic Tags
Share: