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

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

题目:1484. 按日期分组销售产品



题解:

sql 复制代码
select sell_date , count(distinct product) num_sold ,
group_concat(distinct product order by product asc separator ',') products
from Activities
group by sell_date
order by sell_date

题目:1327. 列出指定时间段内所有的下单产品




题解:

sql 复制代码
select p.product_name, t.unit unit from
Products p right join(
    select product_id , sum(unit) unit from Orders
    where order_date>='2020-02-01' and order_date<='2020-02-29'
    group by product_id
    having sum(unit)>=100
) t on t.product_id=p.product_id

题目:1517. 查找拥有有效邮箱的用户



题解:MySQL中【正则表达式】用法

sql 复制代码
select * from Users
where mail regexp '^[a-zA-Z][a-zA-Z0-9\_\\.\-]*@leetcode\\.com$'
相关推荐
小羊在睡觉1 小时前
力扣84. 柱状图中最大的矩形
后端·算法·leetcode·golang·go
sheeta19982 小时前
LeetCode 每日一题笔记 日期:2026.05.29 题目:3300. 最小元素
笔记·leetcode
_日拱一卒2 小时前
LeetCode:994腐烂的橘子
java·数据结构·算法·leetcode·深度优先
唐青枫3 小时前
MySQL EXISTS 详解:存在性判断、NOT EXISTS 与实战示例
sql·mysql
小白兔奶糖ovo5 小时前
【Leetcode】231. 2的幂
linux·算法·leetcode
过期动态6 小时前
【LeetCode 热题 100】接雨水
java·数据结构·算法·leetcode·职场和发展
数据仓库_晨曦10 小时前
【无标题】
大数据·sql·spark
anew___10 小时前
《数据库原理》精要解读(三)—— SQL:与数据库对话的艺术
数据库·sql·oracle