Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Select Anomaly?

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-03-25 : 07:16:26
Aditya Mahajan writes "Select * From TableName
order by 1

The Above is correct

Select * From TableName HaHaHaHeHeHeHarHarHar
order by 1

The Above seems incorrect

But It works!!!!

How? Why?"

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-03-25 : 07:42:43
in your second example the HaHaHaHeHeHeHarHarHar becomes an alias for the table
same as
select *
from orders t1
order by 1

Go with the flow & have fun! Else fight the flow
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-03-25 : 08:16:51

No, the order will not change when using Table Alias.


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -