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 |
|
davidshq
Posting Yak Master
119 Posts |
Posted - 2010-06-22 : 17:13:48
|
| Lets say I have a database with five columns like this:ID FirstName LastName Address CityNow I want to query all the rows in this table:select ID, FirstName, LastName, Address, City from tableNameWhat if I want to add a static value not contained in a column into the result set - for example "staticState" (in pseudo)select ID, FirstName, LastName, Address, City, staticState="PA" from tableNameHow can I accomplish this?Dave |
|
|
vijayisonly
Master Smack Fu Yak Hacker
1836 Posts |
Posted - 2010-06-22 : 17:58:57
|
| [code]select ID, FirstName, LastName, Address, City, 'PA' as [staticState] from tableName[/code] |
 |
|
|
|
|
|