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$'
相关推荐
Sheep Shaun8 小时前
STL:string和vector
开发语言·数据结构·c++·算法·leetcode
Elastic 中国社区官方博客9 小时前
Elasticsearch:使用 ES|QL 与 dense_vector 字段
大数据·数据库·人工智能·sql·elasticsearch·搜索引擎·全文检索
YGGP10 小时前
【Golang】LeetCode 118. 杨辉三角
算法·leetcode
sin_hielo10 小时前
leetcode 2054(排序 + 单调栈,通用做法是 DP)
数据结构·算法·leetcode
mofei1213810 小时前
正则表达式高级用法指南
python·正则表达式·零宽断言·原子分组
玖剹10 小时前
字符串相关题目
c语言·c++·算法·leetcode
Ashley_Amanda11 小时前
SAP ABAP 开发全攻略:从核心编程到最佳实践
大数据·数据库·sql
罗政11 小时前
mybatis-plus插件解决sql报错:this is incompatible with sql_mode=only_full_group_by ”
数据库·sql·mybatis
Swift社区11 小时前
LeetCode 455 - 分发饼干
算法·leetcode·职场和发展