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$'
相关推荐
泷羽Sec-静安30 分钟前
Less-1 GET-Error based-Single quotes-String GET-基于错误-单引号-字符串
前端·css·网络·sql·安全·web安全·less
那我掉的头发算什么33 分钟前
【数据库】navicat的下载以及数据库约束
android·数据库·数据仓库·sql·mysql·数据库开发·数据库架构
Miraitowa_cheems2 小时前
LeetCode算法日记 - Day 84: 乘积为正数的最长子数组长度
数据结构·算法·leetcode·贪心算法·线性回归·深度优先·动态规划
xiaopengbc3 小时前
谷歌商店下载APK教程,先下载谷歌三件套,再直接从 Google Play 下载 APK 文件?
leetcode
大G的笔记本3 小时前
MySQL 大表查询优化、超大分页处理、SQL 慢查询优化、主键选择
数据库·sql·mysql
小蜗的房子6 小时前
MySQL学习之SQL语法与操作
数据结构·数据库·经验分享·sql·mysql·学习方法·数据库开发
Dream it possible!8 小时前
LeetCode 面试经典 150_链表_反转链表 II(60_92_C++_中等)(头插法)
c++·leetcode·链表·面试
py有趣10 小时前
LeetCode学习之实现strStr()
学习·算法·leetcode
夏鹏今天学习了吗10 小时前
【LeetCode热题100(52/100)】课程表
算法·leetcode·职场和发展
祁思妙想10 小时前
【LeetCode100】--- 101.重排链表【思维导图+复习回顾】
算法·leetcode·链表