Write a solution to find for each date the number of different products sold and their names.
The sold products names for each date should be sorted lexicographically.
Return the result table ordered by sell_date
.
The result format is in the following example.
product
들의 종류를 어떻게 가져올 지 몰랐다.GROUP_CONCAT
을 통해 SEPARATOR
를 기준으로 값들을 나누어 가져올 수 있었다.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