我在Hadoop中有一个表,我可以计算特定月份的销售数量
select count(*) from sales where sold_date between '2023-08-01' and '2023-08-31'
字符串如何更新此查询以获取8月份最多销售的日期,而不是整个月的销售计数?
wooyq4lh1#
试试这个:
SELECT sold_date, COUNT(*) as sales_count FROM sales WHERE sold_date BETWEEN '2023-08-01' AND '2023-08-31' GROUP BY sold_date ORDER BY sales_count DESC LIMIT 1;
字符串
1条答案
按热度按时间wooyq4lh1#
试试这个:
字符串