How to replace existing value in table with new value in a query

Learner 226 Reputation points
2022-05-12T13:48:41.55+00:00

I have a table which have columns Country, Region and Sales. Actually I have 70 columns in my table.Its just a sample data.
Now my requirement is I need to create a query which will select all columns from the table, but I have to replace country value as Unknown if it is null.

Could any one please help how to do

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
14,116 questions
0 comments No comments
{count} votes

Accepted answer
  1. Naomi Nosonovsky 7,971 Reputation points
    2022-05-12T14:04:47.14+00:00

    In SSMS right click on the table, use script as SELECT. Then scroll down to the Country column and change is to

    ISNULL(Country, 'Unknown') as Country

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Learner 226 Reputation points
    2022-05-12T14:08:15.957+00:00

    Hi @Anonymous ,

    I need to create this inside a query .
    Could you please help


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.