| Author |
Topic |
|
yanivtz
Starting Member
1 Post |
Posted - 2005-11-15 : 12:40:15
|
| I am rewriting queries from Access to MSSQL. Can I do this in MSSQL: Select 3 as A, 2 as B, A-B as C ? Thank you |
|
|
Vivaldi
Constraint Violating Yak Guru
298 Posts |
Posted - 2005-11-15 : 12:52:31
|
| yes________________________________________________SQL = Serious Quaffing of Liquor |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
Vivaldi
Constraint Violating Yak Guru
298 Posts |
Posted - 2005-11-15 : 13:19:11
|
quote: Originally posted by X002548 SELECT A, B, A-B AS C FROM (SELECT 3 AS A, 2 AS B) AS XXXBrett8-)
So you CAN do it in MSSQL....________________________________________________SQL = Serious Quaffing of Liquor |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
Vivaldi
Constraint Violating Yak Guru
298 Posts |
Posted - 2005-11-15 : 14:01:48
|
quote: Originally posted by X002548
quote: Originally posted by yanivtz Can I do this in MSSQL: Select 3 as A, 2 as B, A-B as C
No, you can't...I used a derived table...Brett8-)Hint: Want your questions answered fast? Follow the direction in this linkhttp://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspxAdd yourself!http://www.frappr.com/sqlteam
A derived table is not something in MSSQL? I have been misinformed.________________________________________________SQL = Serious Quaffing of Liquor |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-11-16 : 01:09:26
|
| >>Select 3 as A, 2 as B, A-B as C Not until you use derived tableBut can use without it when you use order bySelect 3 as A, 2 as B order by AMadhivananFailing to plan is Planning to fail |
 |
|
|
|