有1到12月的记录值,怎样用sql分组查出每季度的值
2个回答
展开全部
SELECT 字段 from tabel where date1 BETWEEN '2014-01-01 0:00:00' AND '2014-03-31 23:59:59'
SELECT 字段 from tabel where date1 BETWEEN '2014-04-01 0:00:00' AND '2014-06-30 23:59:59'
SELECT 字段 from tabel where date1 BETWEEN '2014-07-01 0:00:00' AND '2014-09-30 23:59:59'
SELECT 字段 from tabel where date1 BETWEEN '2014-10-01 0:00:00' AND '2014-12-31 23:59:59'
SELECT 字段 from tabel where date1 BETWEEN '2014-04-01 0:00:00' AND '2014-06-30 23:59:59'
SELECT 字段 from tabel where date1 BETWEEN '2014-07-01 0:00:00' AND '2014-09-30 23:59:59'
SELECT 字段 from tabel where date1 BETWEEN '2014-10-01 0:00:00' AND '2014-12-31 23:59:59'
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询