sql server query

I have a table that has city, state, and zip columns.

When I write  a query as follows:

select city, state, zip from address_table

Open in new window


it will give me what I have in the table, but I want to create a virtual column with default value in my sql statement.  For example

select city, state, zip, county from address_table

Open in new window


I don't have a county column in my table and I don't want to add that to my table.  I want to create a county column in my sql statement with a default value 'Los Angeles'.  How do I write a sql statement that will show all the value in the address_table and plus a virtual column with default values of 'Los Angeles'?

thanks
Nick
LVL 1
countyprobSystem AnalystAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Paul JacksonSoftware EngineerCommented:
select city, state, zip, 'Los Angeles' as county from address_table
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
The above answer is correct assuming that by 'default' you mean value for all rows.

Explain further for us what you're trying to pull off here.  
Are you trying to do a look for each city-zip to county?
0
countyprobSystem AnalystAuthor Commented:
I am trying to use the BI map in the reports and the query needs have county so that I create a map based on county.  My table doesn't have that field.

thanks Jack
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.