发现leetcode上面也有sql题目,把免费的刷一刷总结下
1. UPDATE CASE...WHEN...
UPDATE salary
SET
sex = CASE sex
WHEN 'm' THEN 'f'
ELSE 'm'
END;
2. MOD DESC
select *
from cinema
where mod(id, 2) = 1 and description != 'boring'
order by rating DESC
;
3. Group by Having
select Email
from Person
group by Email
having count(Email) > 1;