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

推荐订阅源

Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
S
SegmentFault 最新的问题
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Attack and Defense Labs
Attack and Defense Labs
F
Full Disclosure
Vercel News
Vercel News
N
News | PayPal Newsroom
The GitHub Blog
The GitHub Blog
H
Hacker News: Front Page
H
Heimdal Security Blog
P
Privacy International News Feed
博客园 - 司徒正美
Google DeepMind News
Google DeepMind News
N
Netflix TechBlog - Medium
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
Cisco Blogs
L
Lohrmann on Cybersecurity
D
Docker
Recent Announcements
Recent Announcements
Security Archives - TechRepublic
Security Archives - TechRepublic
人人都是产品经理
人人都是产品经理
C
CXSECURITY Database RSS Feed - CXSecurity.com
P
Proofpoint News Feed
T
Tailwind CSS Blog
C
Check Point Blog
博客园 - 叶小钗
Google Online Security Blog
Google Online Security Blog
Martin Fowler
Martin Fowler
Stack Overflow Blog
Stack Overflow Blog
博客园 - 聂微东
S
Secure Thoughts
博客园 - Franky
博客园_首页
阮一峰的网络日志
阮一峰的网络日志
P
Palo Alto Networks Blog
Latest news
Latest news
量子位
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 三生石上(FineUI控件)
The Cloudflare Blog
Last Week in AI
Last Week in AI
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Cyberwarzone
Cyberwarzone
小众软件
小众软件
Cisco Talos Blog
Cisco Talos Blog
Hacker News: Ask HN
Hacker News: Ask HN
T
Threatpost
T
Tenable Blog
P
Privacy & Cybersecurity Law Blog
WordPress大学
WordPress大学

博客园 - 雪夜

VS统计代码量 DataTable 操作 - 雪夜 - 博客园 bootstrap 知识点 人脸识别 参考 转盒子 年龄段统计 model 数据注解 delphi ScriptGate 调用JS C#区块链零基础入门,学习路线图 转 SQLServer 2005 和自增长主键identity说再见——NEWSEQUENTIALID() ASP.NET Core and .NET Core Library Support 创新县(市、区)的主要条件 C# imgage图片转base64字符/base64字符串转图片另存成 base64编码的 文件 图片 CSS - 雪夜 - 博客园 Exception has been thrown by the target of an invocation 网站报错 高效通用分页存储过程 多表查询 JavaScript 知识记录 JQuery 全选 取消 博文阅读密码验证 - 博客园
统计销售额
雪夜 · 2018-12-13 · via 博客园 - 雪夜

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 即可。