Is there a right way to format SQL? I've seen no ...
# sql
j
Is there a right way to format SQL? I've seen no consistency between formatters or guidelines. For example, I see these two all of the time:
Copy code
sql
select first_name,
       last_name
from users
Copy code
sql
select 
       first_name,
       last_name
from users
b
There's no "right way" to do it, although most code editors such as VS Code have SQL formatter modules available. Those different formatters may doing things very differently, though. Just use whatever format is comfortable to you or install a formatter and adopt whatever it uses.
j
Thank you!