sql-计算日期范围内的天数?
作者:互联网
我有这样的查询:
SELECT COUNT(*) AS amount
FROM daily_individual_tracking
WHERE sales = 'YES'
AND daily_individual_tracking_date BETWEEN '2010-01-01' AND '2010-03-31'
我是从日期范围中选择的.是否可以获取日期范围内的总天数?
解决方法:
不清楚,如果您正在寻找
DATEDIFF('2010-03-31', '2010-01-01')
要么
COUNT(DISTINCT daily_individual_racking_date)
标签:date-range,sql,mysql 来源: https://codeday.me/bug/20191011/1890615.html