Visual studio feeds

All Visual Studio blogs in one place

Subscribe

Enter your email address:

Delivered by FeedBurner

Increase your website traffic with Attracta.com

Google+

Contact

Email:
Subject:
Message:
Anti-spam: How many eyes has a typical person?

Follow us on FB

Search

Question of the May 2012 - How does direct usage of column alias work in ORDER BY clause?

AddThis Social Bookmark Button
Consider the following two statements --Query 1 select name, dateadd(day,datediff(day,0,create_date),0) as date_only from sys.objects where date_only>getdate()-100 --Query 2 select name, dateadd(day,datediff(day,0,create_date),0) as date_only from sys.objects order by date_only While the first query throws an error Invalid column name 'date_only'. ,How does the second query work?

Home : Blog List : Madhivanan's TSQL Blog : Question of the May 2012 - How does direct usage of column alias work in ORDER BY clause?