Here is an article that is very helpful in this matter: Avoid Transact-SQL's Column Alias Limitations
Key points:
- MS SQL only allow alias in SELECT and ORDER BY
- Use sub-query, can help in some cases to re-use column alias
Tips that make life of a software engineer easier. Well, not exactly. Some posts are open questions that I haven't found an answer ... yet
No comments:
Post a Comment