Author |
Topic |
gsrinivas.
Yak Posting Veteran
56 Posts |
Posted - 2009-06-13 : 10:30:06
|
dear sqlteam,i would like to know the query "select a column from a result set ".hear the result set is not a table or a view.anybody please...thanks-srinivas |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2009-06-13 : 10:33:03
|
so where is the result set coming from ? KH[spoiler]Time is always against us[/spoiler] |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
senthil_nagore
Master Smack Fu Yak Hacker
1007 Posts |
Posted - 2009-06-26 : 02:26:35
|
This you need?Select col1 from (Select col1,col2,col3 from mytable) as tab where <condition>Senthil.C------------------------------------------------------[Microsoft][ODBC SQL Server Driver]Operation canceled |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-06-26 : 06:03:56
|
quote: Originally posted by gsrinivas. dear sqlteam,i would like to know the query "select a column from a result set ".hear the result set is not a table or a view.anybody please...thanks-srinivas
You need to give more informations to avoid guessesMadhivananFailing to plan is Planning to fail |
|
|
gsrinivas.
Yak Posting Veteran
56 Posts |
Posted - 2009-07-04 : 03:52:21
|
yes senthil,thats i want..thanks-srinivas |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-07-04 : 03:57:18
|
quote: Originally posted by senthil_nagore This you need?Select col1 from (Select col1,col2,col3 from mytable) as tab where <condition>
This is the same asSELECT Col1 FROM MyTable WHERE <condition> Microsoft SQL Server MVPN 56°04'39.26"E 12°55'05.63" |
|
|
gsrinivas.
Yak Posting Veteran
56 Posts |
Posted - 2009-07-04 : 04:05:47
|
no peso,this is not i want,i want to select a virtual column from a result set |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-07-04 : 04:30:16
|
And what is a "virtual column" according to your definition?For the link you posted, give the derived table a name like this.Select TheVirualColumnNameHerefrom OPENROWSET('SQLOLEDB','Data Source=Server_name;Trusted_Connection=yes; Integrated Security=SSPI','Execute yourdb..get_orders') AS v Microsoft SQL Server MVPN 56°04'39.26"E 12°55'05.63" |
|
|
gsrinivas.
Yak Posting Veteran
56 Posts |
Posted - 2009-07-06 : 03:31:57
|
dear peso,i want to select annual salary from emp table.for example the emp table contains following columnsempno,empname,monthly_salary.now my quiry is to getting annual salary from emp table................select monthly_salary*12[annula_salary] from emphere, i say annual_salary is virtual column (that is derived column)and the output (grid) is result set.I WANT TO GET THE DERIVED COLUMN FROM RESULT SET .(basically this requirement is need in t-sql block.after executing some pocessing some result set occurs.i want to select some derived columns from that resultset)thanks-gsrinivas |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2009-07-06 : 03:36:01
|
[code]select [annula_salary]from( select monthly_salary*12[annula_salary] from emp) a[/code] KH[spoiler]Time is always against us[/spoiler] |
|
|
Jeff Moden
Aged Yak Warrior
652 Posts |
Posted - 2009-07-19 : 20:39:49
|
quote: Originally posted by gsrinivas. (basically this requirement is need in t-sql block.after executing some pocessing some result set occurs.i want to select some derived columns from that resultset)
I'd really like to see your "T-SQL block" for this... it would help us figure out what you want.--Jeff Moden "Your lack of planning DOES constitute an emergency on my part... SO PLAN BETTER! ""RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row" |
|
|
|