Hi kankon,
Please refer below SQL query.
SQL
CREATE TABLE #Users
(
[Id] INT PRIMARY KEY,
[Name] VARCHAR (20),
[City] VARCHAR(30)
)
INSERT INTO #Users VALUES (1,'User1','India')
INSERT INTO #Users VALUES (2,'User2','India')
INSERT INTO #Users VALUES (3,'User3','Kuwait')
INSERT INTO #Users VALUES (4,'User4','Kuwait')
INSERT INTO #Users VALUES (5,'User5','Kuwait')
INSERT INTO #Users VALUES (6,'User6','Kuwait')
INSERT INTO #Users VALUES (7,'User7','USA')
INSERT INTO #Users VALUES (8,'User8','USA')
INSERT INTO #Users VALUES (9,'User9','USA')
INSERT INTO #Users VALUES (10,'User10','USA')
UPDATE #Users
SET City = 'Kuwait'
WHERE City = 'USA'
SELECT * FROM #Users
DROP TABLE #Users
Output
Id |
Name |
City |
1 |
User1 |
India |
2 |
User2 |
India |
3 |
User3 |
Kuwait |
4 |
User4 |
Kuwait |
5 |
User5 |
Kuwait |
6 |
User6 |
Kuwait |
7 |
User7 |
Kuwait |
8 |
User8 |
Kuwait |
9 |
User9 |
Kuwait |
10 |
User10 |
Kuwait |