我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

在特定月份按周获取所有记录

I want to fetch data weekwise for the particular month.

ex: if i select may month . i need count of first week,count of second week ,count of third week and so on

enter image description here

use the following query.

select
      concat(year(date_format(timefield, '%Y-%m-%d')), ' week ', substring_index(dayofyear(date_format(timefiels, '%Y-%m-%d'))/7+1, '.', 1)) as time,
      sum(sales) as sales 
 from 
      account 
where 
      timefield>='2014-05-01 00:00:00' 
  and timefield<='2014-05-31 23:59:59'

group by
          time;

近期文章

  • 订单的表税是否存储在数据库中?
  • foreach错误试图获取非对象的属性
  • Jquery PHP ajax在发送时显示服务器响应
  • php - php 5.2和5.5中的差异$ _SESSION行为
  • 如何使用jQuery / jFeed从php页面解析rss?
  • 我需要特殊字符的帮助到我的phpmyadmin
  • paypal快速结账后缺少会话数据
  • SQL从刚刚插入的行中获取ID
  • 如何让behat知道使用哪个功能上下文?
  • 使用highcharts从数据库预处理数据
  • SQL语法错误。 check对应MYSQL服务器
  • 使用Google Maps API V3构建坐标数组
  • Doctrine 2 ArrayCollections - 我错过了什么吗?
  • 试图找到任何日期的前六天
  • 如何在WordPress中按选定的标签显示帖子?
  • 如何在Android SMS消息上保留超链接
  • php ORA-01861:literal与格式字符串不匹配
  • php脚本输出原始HTML但仅在编辑后输出
  • dirname($ _ SERVER [“PHP_SELF”])如何正确返回bar?
  • 在Doctrine arraycollection中使用foreach循环

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华