Link Search Menu Expand Document

627. Swap Salary

Solution Code

MySQL

UPDATE salary
SET sex = (CASE WHEN sex = 'm' THEN 'f' 
                WHEN sex = 'f' THEN 'm' ELSE
                'a'
           END);

© 2023. All rights reserved.