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$'
相关推荐
6Hzlia2 小时前
【Hot 100 刷题计划】 LeetCode 42. 接雨水 | C++ 动态规划与双指针题解
c++·算法·leetcode
abant23 小时前
leetcode 114 二叉树变链表
算法·leetcode·链表
XiYang-DING4 小时前
【LeetCode】 225.用队列实现栈
算法·leetcode·职场和发展
派大星~课堂4 小时前
【力扣-148. 排序链表】Python笔记
python·leetcode·链表
小白菜又菜5 小时前
Leetcode 657. Robot Return to Origin
python·leetcode·职场和发展
_深海凉_5 小时前
LeetCode热题100-环形链表
算法·leetcode·链表
splage5 小时前
Oracle分页sql
数据库·sql·oracle
memcpy05 小时前
LeetCode 904. 水果成篮【不定长滑窗+哈希表】1516
算法·leetcode·散列表
老四啊laosi5 小时前
[双指针] 8. 四数之和
算法·leetcode·四数之和
田梓燊5 小时前
leetcode 41
数据结构·算法·leetcode