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.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Update Data

Author  Topic 

kabon
Starting Member

48 Posts

Posted - 2013-05-16 : 00:54:20
If I have table like this :

ID | NAME | CLASS |
123 | Ace | A01 |
456 | Jie | A02 |
789 | Rose | A02 |
145 | David | B01 |

I want to know how to Update Class A02 into B01.

Manually i have codes like this:
select ID,NAME, REPLACE(CLASS,'A02','B01') from student

but i want to change it from table to, so i use Select * from student,
class A02 will automatically change into B01.

please for help

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-05-16 : 01:51:40
[code]
UPDATE table
SET CLASS = 'B01'
WHERE CLASS = 'A02'
[/code]

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -