SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Update Data
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

kabon
Starting Member

Indonesia
48 Posts

Posted - 05/16/2013 :  00:54:20  Show Profile  Reply with Quote
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

India
52325 Posts

Posted - 05/16/2013 :  01:51:40  Show Profile  Reply with Quote

UPDATE table
SET CLASS = 'B01'
WHERE CLASS = 'A02'


------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000