by no_protocol · 10y ago · 0 comments
SELECT first_name
, last_name
, email_address
FROM users
Can anyone speculate why it's not done this way in the guide? I think the reasoning behind it was to make later modification easier because adding or removing the last field required modifying two lines.1. putting the comma before doesn't actually make commenting out columns easier - it just moves the problem to the other end of the list. Just try commenting out `first_name` in your example and you'll see what I mean.
2. because normal convention would be for the comma to come immediately after an item in written English.
SELECT
-- first_name
, last_name
, email_address
FROM users
When parsed it will look like this query error to the system: SELECT
, last_name
, email_address
FROM users