how to update a null value field in sql server
eg
a table contains 3 fields id,name,salary
and 3 records
salary of 1 record is null
i want update the nullfield
111 arun 300
112 ddd 200
113 ttt null
i want to update table with add 100 to every record include null
after updation
the recrds should be
111 arun 400
112 ddd 300
113 ttt 100
Answer Posted / mohan
create table #temp (eid int, names varchar(10),sal int)
insert into #temp values (111, 'arun', 300)
insert into #temp values(112, 'ddd', 200)
insert into #temp values(113,'ttt',null)
select * from #temp
update #temp
set sal = isnull(sal,0)+ 100
select * from #temp
Is This Answer Correct ? | 6 Yes | 2 No |
Post New Answer View All Answers
What is dml command?
What is clustered primary key?
Describe different Processing Modes offered by SSRS?
What are the drawbacks of reporting in ssrs?
What are the different types of normalization?
What is ssrs?
Explain what is the difference between a local and a global temporary table?
Please explain the characteristics of a transaction server for example atomicity, consistency, isolation, durability?
What is difference between equi join and natural join?
how to overcome kernel isssues
Explain a join?
What are the advantages of using stored procedures in sql server?
What is the user of Primary key?
What are the types of indexing?
What are synonyms?