How to update two records at a time?
In the video, it is teaching how to update a record by using WHERE clause. (WHERE emp_no = 999901)
If we want to update two employees in the same time, how can we write?
Great to have you in the course and thanks for reaching out!
You can use the following syntax:
UPDATE table_name SET column_name_1 = CASE column_name_2 WHEN 'name1' THEN 'value' WHEN 'name2' THEN 'value2' ELSE column_name_1 END WHERE column_name_2 IN('name1', 'name2');
Hope this helps.
could you pls explain the role of the else rest of the code I understood but not the else column_name_1 code?
Thanks in advance
(also it would be more beneficial if this kind of important stuff would be added as a bonus tutorial)