惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 司徒正美
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
美团技术团队
WordPress大学
WordPress大学
罗磊的独立博客
Last Week in AI
Last Week in AI
人人都是产品经理
人人都是产品经理
爱范儿
爱范儿
MongoDB | Blog
MongoDB | Blog
J
Java Code Geeks
H
Hackread – Cybersecurity News, Data Breaches, AI and More
H
Help Net Security
S
SegmentFault 最新的问题
C
Check Point Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
腾讯CDC
Engineering at Meta
Engineering at Meta
The GitHub Blog
The GitHub Blog
F
Fortinet All Blogs
D
DataBreaches.Net
雷峰网
雷峰网
GbyAI
GbyAI
宝玉的分享
宝玉的分享

博客园 - ㄓㄤㄑㄧㄤ

sdkman同时存在多个jdk的方式 com.alibaba.druid.pool.DataSourceClosedException: dataSource already closed at Sat Apr 20 09:55:48 CST 2024 $elemMatch使用 python部署在后台执行 SpringBoot获取当前运行环境三种方式 nginx流量复制将请求同时发送到正式和测试环境 一个注解优雅的实现 接口数据脱敏 centOS7 开放/移除指定IP访问指定端口 mac 系统升级到12.4后 mvn 命令 报错:No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? mac Zip 常用命令 Mac下php服务部署 更新setuptools和pip时报错Command "python setup.py egg_info" failed with error code 1 in 解决 CentOS 7 执行 firewall-cmd 防火墙命令遇到的 ModuleNotFoundError: No module named ‘gi’ 最新Centos7安装python3并与python2共存 springcloud2.0以上版本_eureka控制台显示_找不到${spring.cloud.client.ipAddress}_没有显示成IP地址 RestTemplate 统一添加 Header 删除centos7中自带有python2.7 Git 常用命令,持续更新 python操作mongodb查询出现Object of type 'ObjectId' is not JSON serializable解决方法
sqlserver按年、季度、月份、周统计订单销量
ㄓㄤㄑㄧㄤ · 2021-08-10 · via 博客园 - ㄓㄤㄑㄧㄤ

按周统计
SELECT TOP 10
DATENAME(year,AddDate) 年,
DATENAME(week,AddDate) 周,
COUNT(1) 单量,
SUM(total) 总金额,
AVG(total) 客单价
FROM orderinfo t(NOLOCK)
WHERE AddDate BETWEEN '2013-1-1' AND '2014-1-1'
GROUP BY DATENAME(year,AddDate),DATENAME(week,AddDate)
ORDER BY CONVERT(INT,DATENAME(week,AddDate));

----------------------------------------------------------------
--按月统计
SELECT TOP 10
DATENAME(year,AddDate) 年,
DATENAME(month,AddDate) 月,
COUNT(1) 单量,
SUM(total) 总金额,
AVG(total) 客单价
FROM orderinfo t(NOLOCK)
WHERE AddDate BETWEEN '2013-1-1' AND '2014-1-1'
GROUP BY DATENAME(year,AddDate),DATENAME(month,AddDate)
ORDER BY CONVERT(INT,DATENAME(month,AddDate));

----------------------------------------------------------------
--按季度统计
SELECT TOP 10
DATENAME(year,AddDate) 年,
DATENAME(quarter,AddDate) 季度,
COUNT(1) 单量,
SUM(total) 总金额,
AVG(total) 客单价
FROM orderinfo t(NOLOCK)
WHERE AddDate BETWEEN '2013-1-1' AND '2014-1-1'
GROUP BY DATENAME(year,AddDate),DATENAME(quarter,AddDate)
ORDER BY CONVERT(INT,DATENAME(quarter,AddDate));

----------------------------------------------------------------
--按年统计
SELECT TOP 10
DATENAME(year,AddDate) 年,
COUNT(1) 单量,
SUM(total) 总金额,
AVG(total) 客单价
FROM orderinfo t(NOLOCK)
WHERE AddDate BETWEEN '2012-1-1' AND '2014-1-1'
GROUP BY DATENAME(year,AddDate)
ORDER BY CONVERT(INT,DATENAME(year,AddDate));

转自:https://www.etuan.com/zx/116-151613.html