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$'
相关推荐
富贵儿9983 分钟前
NL2SQL 实践手记 10:从命令行到网页查询——把整个系列串起来
数据库·python·sql·ai·自然语言处理·langchain
小白的高手之路11 分钟前
【LeetCode 热题 100】560. 和为 K 的子数组|前缀和、哈希表(Python)
数据结构·笔记·python·算法·leetcode·力扣·散列表
这个DBA有点耶1 小时前
从逻辑日志到物理日志:实时数据同步的 DDL 与断点续传工程解
数据库·sql·程序人生·运维开发·dba
在角落发呆2 小时前
sql创建备份表全攻略:从 SELECT INTO 到跨机容灾
数据库·windows·sql·自动化·备份
weixin_307779133 小时前
Python用正则把 SQL 关键字整词匹配后转成小写
开发语言·python·sql·算法
AAA修煤气灶刘哥3 小时前
SQL 一行没改,ClickHouse 的 JOIN 中间结果怎么从 5 亿行降到 100 万?
后端·sql·性能优化
富贵儿9984 小时前
NL2SQL 实践手记 09:答案正确以后,还能更快吗——一次可核对的 AI4DB 实验
数据库·python·sql·ai·自然语言处理·langchain
劲夫学编程4 小时前
leetcode: 字母异位词分组
算法·leetcode
wy_hhxx5 小时前
[Leetcode] 动态规划(打家劫舍、0-1背包、完全背包)
算法·leetcode·动态规划·完全背包·0-1背包
Decay__5 小时前
PostgreSQL 故障处理案例集 —— 高频故障定位与处置(复制中断、锁阻塞、磁盘满、误删、连接风暴、膨胀)
运维·数据库·sql·postgresql