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
 Update Query

Author  Topic 

rajnidas
Yak Posting Veteran

97 Posts

Posted - 2013-11-15 : 00:49:25

hi every one

i want to update multiple column in one table using with case statement. i need query pls..


stdid name subject result marks
1 arun chemistry pass 55
2 alias maths pass 70
3 babau history pass 55
4 basha hindi NULL NULL
5 hussain hindi NULL nULL
6 chandru chemistry NULL NULL
7 mani hindi NULL NULL
8 rajesh history NULL NULL
9 rama chemistry NULL NULL
10 laxman maths NULL NULL


Thanks

bandi
Master Smack Fu Yak Hacker

2242 Posts

Posted - 2013-11-15 : 01:57:10
Hi,
What should be the result of above table post UPDATE

--
Chandu
Go to Top of Page

bandi
Master Smack Fu Yak Hacker

2242 Posts

Posted - 2013-11-15 : 01:59:43
UPDATE TableName
SET column1 = CASE WHEN <Condition> THEN SomeVlaue ELSE OtherValue END ,
column2 = 'Something'



--
Chandu
Go to Top of Page
   

- Advertisement -