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.
Author |
Topic |
Mahavirjadhav
Starting Member
18 Posts |
Posted - 2014-11-27 : 19:49:13
|
Hi,I have written following query select biz_id as Id1 from biz_info where Id1> 5000The above query is giving error 'Invalid column name Id1'Please help.Thanks.Mahavir |
|
MuralikrishnaVeera
Posting Yak Master
129 Posts |
Posted - 2014-11-28 : 01:51:31
|
You can't use this alias unless it is a subquery---------------Murali KrishnaYou live only once ..If you do it right once is enough....... |
|
|
Ifor
Aged Yak Warrior
700 Posts |
Posted - 2014-11-28 : 05:28:33
|
The order of evaluation of the main SQL clauses is:FROM, including JOINSWHEREGROUP BYHAVINGSELECTORDER BYAs you can see, the alias Id1 has not yet been defined when the WHERE clause is evaluated. |
|
|
marcusn25
Yak Posting Veteran
56 Posts |
Posted - 2014-11-29 : 19:46:56
|
select *from(selectbiz_id as Id1 from biz_info ) bizwhere biz.Id1> 5000Marcus I learn something new everyday. |
|
|
|
|
|