0
点赞
收藏
分享

微信扫一扫

完整版:TCP、UDP报文格式

四月天2021 2023-08-14 阅读 14
算法sql

题目

表 Activities

编写解决方案找出每个日期、销售的不同产品的数量及其名称。
每个日期的销售产品名称应按词典序排列。
返回按 sell_date 排序的结果表。
结果表结果格式如下例所示。

示例 1:

  

 

解题思路

前置知识

代码实现

select
    sell_date,
    count(distinct product) as num_sold,
    group_concat(distinct product order by product separator ',' ) as products
    from Activities
    group by sell_date
    order by sell_date

测试结果

 

举报

相关推荐

0 条评论