select
[user].id,
[user].name,
snowboard.name as snowboard
from [user]
inner join snowboard on snowboard.id = [user].snowboard_id
try this
select
[user].id,
[user].name,
snowboard = snowboard.name
from [user]
inner join snowboard on snowboard.id = [user].snowboard_id
It helps all the columns line up and read nicer.
One convention I like to use is putting commas in the select clause at the beginning of the line instead of the end. example:
ReplyDeleteselect
[user].id
,[user].name
,snowboard = snowboard.name
Helps to spot missing commas since they're all lined up instead of at the end of the line, and allows me to comment out lines easily when debugging without mistakenly generating a SQL syntax error.
Nice.
ReplyDeleteI've seen that before, but have resisted it. I think enough people have called me out on it that I should make the change.
It makes sense. And like you said, it helps with commenting.