LeetCode 高频 SQL 50 题(基础版)之 【高级字符串函数 / 正则表达式 / 子句】· 上

题目:1667. 修复表中的名字



题解:

sql 复制代码
select user_id, concat(upper(left(name,1)),lower(right(name,length(name)-1)))  name 
from Users
order by user_id

题目:1527. 患某种疾病的患者



题解:

sql 复制代码
select * from Patients
where conditions regexp '^DIAB1|\\sDIAB1'

题目:196. 删除重复的电子邮箱



题解:

sql 复制代码
delete p1 
from Person p1,Person p2
where p1.email=p2.email and p1.id>p2.id

题目:176. 第二高的薪水



题解:

sql 复制代码
select ifNUll((select distinct salary 
from Employee
order by salary desc
limit 1,1),null) SecondHighestSalary
相关推荐
Forever Nore11 小时前
LeetCode 14 最长公共前缀 - 纵向扫描
linux·服务器·leetcode
vHelios11 小时前
SQL不会写?不会找关联表?复杂SQL语句编写逻辑实现思路请查收✉
数据库·sql
c2385611 小时前
《算法武林谱:四大排序神功与二分寻宝术全解》
数据结构·算法·排序算法
圣保罗的大教堂11 小时前
leetcode 3090. 每个字符最多出现两次的最长子字符串 简单
leetcode
一米阳光866111 小时前
软考(中级)软件设计师核心笔记(9)算法——时间复杂度与空间复杂度、查找算法、排序算法
笔记·算法·职场发展·软考·软件设计师·中级职称
Mem0rin11 小时前
二分查找:左右边界
数据结构·算法
大明者省21 小时前
WSL2 Ubuntu22.04 GPU训练环境配置指南
人工智能·算法·计算机视觉
白狐_7981 天前
408数据结构第8章:排序②——性质对比秒杀、场景选择与外部排序
java·数据结构·算法
zander2581 天前
LeetCode 84:柱状图中的最大矩形——单调栈如何确定左右边界
java·数据结构·算法
Shell运维手记1 天前
Linux 常用基础命令学习笔记
linux·运维·笔记·学习·算法·github