我有这样的查询:
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)