3 ms·
I've been doing some SQL again and one technique I learned years ago was having each thing on its own line, both to reduce churn in version control and allow fo
by Cthulhu_ 1y ago
I've been doing some SQL again and one technique I learned years ago was having each thing on its own line, both to reduce churn in version control and allow for easier reordering and commenting out.
Instead of
SELECT foo, bar, quux FROM baz WHERE storge = 'grault';
do
SELECT
foo
,bar
,quux
FROM
baz
WHERE
storge = 'grault'
;
It's pretty hideous in this example but for bigger queries maintained over a long period of time it can be beneficial. I assume, it's been nearly 20 years since I did anything more serious with SQL.