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$'
相关推荐
oradh5 小时前
Oracle固定执行计划的方法----SQL Profie(三)
数据库·sql·oracle
Tisfy6 小时前
LeetCode 0020.有效的括号:栈匹配
算法·leetcode·字符串·题解·括号匹配
Navigator_Z6 小时前
LeetCode //C - 1276. Number of Burgers with No Waste of Ingredients
c语言·算法·leetcode
做运维的阿瑞7 小时前
mysql数据库分组查询:GROUP BY 与 HAVING 的执行逻辑
数据库·sql·mysql
想吃火锅10057 小时前
【leetcode】189.轮转数组js
开发语言·javascript·leetcode
阳光九叶草LXGZXJ7 小时前
达梦数据库-学习-67-SSL加密认证
linux·运维·数据库·sql·学习·ssl
驭渊的小故事7 小时前
MyBatis 入门:从 JDBC 到优雅操作数据库(一)
笔记·sql·spring
Wx-bishekaifayuan8 小时前
springboot房屋租赁系统11574-计算机课程设计、毕业设计
java·vue.js·spring boot·后端·sql·spring·课程设计
All for pursuit.8 小时前
【贪心-2】253.会议室 II
数据结构·c++·算法·leetcode
阳光九叶草LXGZXJ9 小时前
达梦数据库-学习-68-dmasm0X_XXXXXX.log日志激增
linux·运维·数据库·sql·学习