A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
Hi @Shambhu Rai
Try this query, added the logic that the original value is maintained when the case condition is not met.
UPDATE #table1
SET col3 = CASE WHEN col1=1 and col2=2 THEN 'X'
WHEN col1=3 and col2=4 THEN 'Y'
WHEN col1=5 and col2=6 THEN 'Z'
ELSE col3 END,
col4 = CASE WHEN col1=1 and col2=2 THEN 'R1'
WHEN col1=3 and col2=4 THEN 'R2'
WHEN col1=5 and col2=6 THEN 'R3'
ELSE col4 END;
Best regards,
Cosmog Hong
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.