When I checked the BOL i found that there is a line stating:
If a table name is aliased in the FROM clause, only the alias name can be used to qualify its columns in the ORDER BY clause.
I did some modification in the query and try to run following scenarios and these all are working.
select a ss from test t
order by ss
select t.a ss from test t
order by a
select a from test t
order by a
Can anyone tell me what does that BOL line means?
_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/