How to update the column status basis on other columns

Naresh y 146 Reputation points
2024-02-29T04:23:38.7533333+00:00

Hi Team , I have a status columns like ,value_new,value_old,Imt_status I would like to update the imt_status based on the changes on value_new/value_old,conditionare here ,condition 1 : if the imt_status is empty /contains a value then it will pick for the new value_new/value_old(not null value from both the columns ) will update into the imt_status table ,condition 2 : if the imt_status is empty/contains a value it should take the latest value from the value_old and update into the imt_status column.Please share the update condition logic for the above logic,attached is the data screeahooof which expectation Screenshot_20240228_234003

SQL Server | Other
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.