TreeviewCopyright © aleen42 all right reserved, powered by aleen42

627. 交换工资

https://leetcode-cn.com/problems/swap-salary/

MySQL

# Write your MySQL query statement below

# 使用 UPDATE 和 CASE...WHEN 语句
UPDATE salary SET sex = 
    CASE sex
        WHEN 'm' THEN 'f'
        ELSE 'm'
    END;

SQLServer

/* Write your T-SQL query statement below */

/* 使用 UPDATE 和 CASE...WHEN 语句 */
update salary set sex = 
    case sex
        when 'm' then 'f'
        else 'm'
    end;
Copyright © GoogTech 2021 all right reserved,powered by GitbookLast update time : 2021-09-15 01:55:05

results matching ""

    No results matching ""