2 ms·
Trailing commas is the source of 95% of my SQL syntax errors. I know I _could_ put them at the start of the line, but it's unintuitive.
by petepete 1y ago
Trailing commas is the source of 95% of my SQL syntax errors. I know I _could_ put them at the start of the line, but it's unintuitive.
- zarzavat 1y agoI recommend writing a function to remove trailing commas from SQL. Big time save.
- hk1337 1y agoI like the comma in front for SQL better than at the end but you still have the problem of one of the fields missing a comma, the first field instead of the last but I guess maybe you're more likely to move fields and forget to add/remove a comma at the end.
- neocron 1y agoWho writes trailing commas in sql?In every company I worked with the standard was prefix commas: <pre><code> var , var2 , var3 , var4 </code></pre>