627_Swap Salary
Given a table salary
, such as the one below, that has m=male and f=female values. Swap all f and m values (i.e., change all f values to m and vice versa) with a single update query and no intermediate temp table.
For example:
After running your query, the above salary table should have the following rows:
Solution 1: using IF() function
Solution 2: using CASE syntax
Last updated