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$'
相关推荐
孟意昶5 小时前
Spark专题-第三部分:性能监控与实战优化(1)-认识spark ui
大数据·数据仓库·sql·ui·spark·etl
YuTaoShao5 小时前
【LeetCode 每日一题】2221. 数组的三角和
数据结构·算法·leetcode
Excuse_lighttime6 小时前
除自身以外数组的乘积
java·数据结构·算法·leetcode·eclipse·动态规划
Jiezcode8 小时前
LeetCode 138.随机链表的复制
数据结构·c++·算法·leetcode·链表
阿巴~阿巴~8 小时前
MySQL复合查询(重点)
服务器·数据库·sql·mysql·ubuntu
jingfeng51410 小时前
I/O 多路转接select、poll
linux·数据库·sql
Q741_14711 小时前
C++ 位运算 高频面试考点 力扣 371. 两整数之和 题解 每日一题
c++·算法·leetcode·面试·位运算
aramae11 小时前
链表理论基础
数据结构·c++·算法·leetcode·链表
liuyao_xianhui11 小时前
四数之和_优选算法(C++)双指针法总结
java·开发语言·c++·算法·leetcode·职场和发展