问题1:查询出Person表中重复的email
Person表
id email
select email from Person group by email having count(email)>1;
问题2:交换男(m)女(f)
salary表
id name salary sex
1 A 1000 m
2 B 2000 f
3 C 3000 m
4 D 4000 f
update salary set sex=
case sex when 'm' then 'f'
when 'f' then 'm'
end;
问题3:返回第二高的薪水
id salary
1 100
2 200
3 300
4 400
select salary from tb_salary order by salary desc limit 1 offset 1;
點擊查看更多內容
1人點贊
評論
評論
共同學習,寫下你的評論
評論加載中...
作者其他優質文章
正在加載中
感謝您的支持,我會繼續努力的~
掃碼打賞,你說多少就多少
贊賞金額會直接到老師賬戶
支付方式
打開微信掃一掃,即可進行掃碼打賞哦