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 / ganesh.k
UPDATE Table_Name SET Salary = COALESCE(Salary,0) + 100
(Or)
UPDATE Table_Name SET Salary = ISNULL(Salary,0) + 100
Is This Answer Correct ? | 15 Yes | 2 No |
Post New Answer View All Answers
What is the purpose of floor function?
Can binary strings be used in arithmetical operations?
What are the 7 disadvantages to a manual system?
What is rtm version in sql server?
You want to use a perspective in an mdx query. How do you select the perspective?
Write the SQL query to drop, truncate and delete table.
The external application that is executed in one of the tasks does not have a log file, but only a screen log. How can I save the data from the screen? : sql server management studio
Please explain go command in sql server?
Does group by or order by come first?
How do I edit a procedure in sql server?
Can you explain how long are locks retained within the repeatable_read and serializable isolation levels, during a read operation with row-level locking?
How to name query output columns in ms sql server?
What is a collation in ms sql server?
What is a primary index?
What is resultset concur_updatable?