A few weeks ago, I wrote a post about forming a new habit: always terminate statements with semi-colons. Today I thought I would start a series on kicking bad habits that many of us have developed over time. Today's topic: using ordinal numbers in our ORDER BY clauses. At least once a week, I catch myself using ordinal position to define order. For example, I might have this: SELECT foo, bar FROM dbo.splunge ORDER BY 1, 2 DESC; This is lazy shorthand, and is bound to get screwed up at som...
|
1
kudos |
|
||||
No comments yet, be the first one to post comment.