I have two columns in my table . Code and DocEntery . If DocEntry has value 'NULL' I want it to change to the value of corresponding 'Code' value .There are many rows so could you tell me any query that can be used to update the complete table ? I am using SQL server.
No need to update the enitre table or use any sort of CASE EXPRESSION or IF, just filter only those will NULL values, and update all of them:
UPDATE YourTable t
SET t.DocEntry = t.Code
WHERE t.DocEntry is null
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With