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 |
|
JP_xpto
Starting Member
10 Posts |
Posted - 2002-11-11 : 07:20:40
|
| I think this is a begginer thing...;)Supose i have this query:SELECT (XXXXXX-YYYYYY) as MyproblemFROM TABvWHERE Myproblem <>0Is any way i can do that without declaring again the (XXXXXX-YYYYYY) in the 3 line of the query? I just want to say Myproblem <> 0. |
|
|
Merkin
Funky Drop Bear Fearing SQL Dude!
4970 Posts |
Posted - 2002-11-11 : 07:33:23
|
| No sorry. You can't do it that way, you have to re-evaluate the expression.You can use the alias in an Order By statement though.Damian |
 |
|
|
mr_mist
Grunnio
1870 Posts |
Posted - 2002-11-11 : 07:41:37
|
| You could do thisselect * from(SELECT (XXXXXX-YYYYYY) as Myproblem FROM TABv )thingWHERE Myproblem <>0 |
 |
|
|
JP_xpto
Starting Member
10 Posts |
Posted - 2002-11-12 : 04:27:54
|
| Tks, thats all i want to know. |
 |
|
|
|
|
|