Sql 每月,每日,每年统计
来源:互联网 发布:网络歌曲 什么什水自流 编辑:程序博客网 时间:2024/05/16 08:29
1、每年select year(ordertime) 年, sum(Total) 销售合计from 订单表group by year(ordertime)
2、每月select year(ordertime) 年, month(ordertime) 月, sum(Total) 销售合计from 订单表group by year(ordertime), month(ordertime
3、每日select year(ordertime) 年, month(ordertime) 月, day(ordertime) 日, sum(Total) 销售合计from 订单表group by year(ordertime), month(ordertime), day(ordertime)
另外每日也可以这样:select convert(char(8),ordertime,112) dt, sum(Total) 销售合计from 订单表group by convert(char(8),ordertime,112) 如果需要增加查询条件,在from后加where 即可。
- Sql 每月,每日,每年统计
- 统计每年每月每日数据
- orale 查询每年、每月、每日统计量的sql语句
- orale 查询每年、每月、每日统计量的sql语句
- MYSQL统计每年、每月、每日的数据
- SQL统计每年每月的信息
- SQL语句统计每天、每月、每年的 数据
- 一个sql题目, 统计每年每月的信息
- SQL语句统计每天、每月、每年的 数据
- SQL语句统计每小时,每天、每月、每年的_数据
- SQL语句统计每天、每月、每年的数据
- SQL语句统计每天、每月、每年的数据
- 统计每年每月的信息
- 数据库专题——SQL语句统计每天、每月、每年的数据
- 分享[ASP.NET] SQL语句统计每天、每月、每年的数据 编辑:吴立星
- SQL2000 统计每周,每月,每季,每年的数据
- 每年每月多少天
- 每年每月有几天
- winForm listview 添加进程项目
- Fedora中配置SSH
- UILocalNotification实现本地的闹钟提醒的方法
- Netlink系列2Netlink socket地址结构
- SharedPreferences的用法
- Sql 每月,每日,每年统计
- Word中如何隐藏菜单栏
- 粗看+Android+4.0+界面变化
- where子句的运用
- winform C#实现查看收藏夹功能
- 学会总结,不断反省
- C#基础概念二十五问
- 远程桌面连接时将本机上的东西带到远程计算机上
- java怎么实现导出excel表(poi包的应用)