本文介绍了计算日期范围内的天数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这样的查询:

SELECT COUNT(*) AS amount
FROM daily_individual_tracking
WHERE sales = 'YES'
AND daily_individual_tracking_date BETWEEN '2010-01-01' AND '2010-03-31'

我是从一个日期范围中选择的.有没有办法获取日期范围内的总天数?

I am selected from a date range. Is there a way to also get the total days in the date range?

推荐答案

如果要查找并不清楚

DATEDIFF('2010-03-31', '2010-01-01')

COUNT(DISTINCT daily_individual_racking_date)

这篇关于计算日期范围内的天数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-19 16:03