题目:1667. 修复表中的名字
题解:
select user_id, concat(upper(left(name,1)),lower(right(name,length(name)-1))) name
from Users
order by user_id
题目:1527. 患某种疾病的患者
题解:
select * from Patients
where conditions regexp '^DIAB1|\\sDIAB1'
题目:196. 删除重复的电子邮箱
题解:
delete p1
from Person p1,Person p2
where p1.email=p2.email and p1.id>p2.id
题目:176. 第二高的薪水
题解:
select ifNUll((select distinct salary
from Employee
order by salary desc
limit 1,1),null) SecondHighestSalary