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 |
|
batcater98
Starting Member
22 Posts |
Posted - 2008-07-30 : 15:55:13
|
| I have a select statement that creates new columns derived from other table items. I then want to use those created columns in the same select statement to create more.Example:select sum(e.val1 * e.val2/100) as Key1, Key1 / e.val2 as Key3I can do this in access, but can not figure out how to do the same thing in MSSQL.I want to use the value created and stored in Key1 to make Key3.Is this possible in MSSQL?Thanks,Ad.Regards,The Dark Knight-Give What is Right, Not What is Left- |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-07-31 : 04:11:13
|
| or use the expression in place of columnselect sum(e.val1 * e.val2/100) as Key1, sum(e.val1 * e.val2/100) / e.val2 as Key3MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|