Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Personaly, I put the comma before the column name :

  SELECT
     col1
     ,col2
     ,col3
It's easier for me to add a column or move it like this. Otherwise I have to search the comma when my query has only one column and I add one or when I add a column at the end


I know this is a question of style, but wow that looks ugly.

The point about ease of adding a new column is absolutely valid.

The best answer to it, subjectively and IMHO, is on the language level, e.g. making it legal to end the statement with a comma:

SELECT col1, col2, col3, from ...


That would definitely be a game changer... but I'm not sure I might be ready for that !




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: