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
 General SQL Server Forums
 New to SQL Server Programming
 How to Interchange two row values in sql server?

Author  Topic 

rajeshforum
Starting Member

3 Posts

Posted - 2007-08-23 : 05:29:42
Hi all!
how to interchange two row values?

ID NAME
1 DotNet
2 Java
3 DotNet
4 Java
this s the sample table..
here i want to interchange java to dotnet and vice versa.





rajesh

Koji Matsumura
Posting Yak Master

141 Posts

Posted - 2007-08-23 : 05:47:14
UPDATE YourTable SET Name = CASE Name WHEN 'DotNet' THEN 'Java' WHEN 'Java' THEN 'NotNet' END
Go to Top of Page

DonAtWork
Master Smack Fu Yak Hacker

2167 Posts

Posted - 2007-08-23 : 07:32:56
Step 1: Normalize your tables
Step 2: All following steps will be that much easier.

[Signature]For fast help, follow this link:
http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspx
Learn SQL
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp
Go to Top of Page
   

- Advertisement -