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 |
|
zhshqzyc
Posting Yak Master
240 Posts |
Posted - 2008-07-29 : 12:07:10
|
a query just asselect 676 as x The query with "from tablename"I don't know if it is okay or not.Thanks |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2008-07-29 : 12:21:18
|
| Did you try running it in the query analyzer? Also, look at Books On Line under select clauseJim |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-07-29 : 12:56:21
|
quote: Originally posted by zhshqzyc a query just asselect 676 as x The query with "from tablename"I don't know if it is okay or not.Thanks
why do you want from tablename here. you're just using a constant name so dont need a table name to refer to |
 |
|
|
blindman
Master Smack Fu Yak Hacker
2365 Posts |
Posted - 2008-07-29 : 13:18:43
|
| That's a column alias, not a table alias. Maybe he wants the value to show up with a label.e4 d5 xd5 Nf6 |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-07-29 : 13:33:49
|
quote: Originally posted by blindman That's a column alias, not a table alias. Maybe he wants the value to show up with a label.e4 d5 xd5 Nf6
nope i was referring to this partThe query with "from tablename" |
 |
|
|
blindman
Master Smack Fu Yak Hacker
2365 Posts |
Posted - 2008-07-29 : 13:37:06
|
| Then I'm with you. I don't know what the heck he is talking about.e4 d5 xd5 Nf6 |
 |
|
|
zhshqzyc
Posting Yak Master
240 Posts |
Posted - 2008-07-29 : 13:59:51
|
| Yeah. I want the value to show up with a label |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2008-07-29 : 15:19:19
|
| Hi,you can do select 676 as xin a query-window and your result is 676 with label xYou can do alsoselect 676 as x,your_id,your_namefrom your_table where ...and your result (depending on contents of your_table) will have various ids and names and always x as first column with its value 676.GreetingsWebfredThere are 10 types of people in the world: Those who understand binary, and those who don't... |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-07-30 : 03:55:26
|
quote: Originally posted by zhshqzyc a query just asselect 676 as x The query with "from tablename"I don't know if it is okay or not.Thanks
In SQL Server, you dont need table name to select just a constant unlike you need dual table in ORACLEMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|