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

推荐订阅源

Help Net Security
Help Net Security
G
Google Developers Blog
雷峰网
雷峰网
WordPress大学
WordPress大学
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Engineering at Meta
Engineering at Meta
Security Latest
Security Latest
T
Threat Research - Cisco Blogs
AWS News Blog
AWS News Blog
F
Full Disclosure
C
Cybersecurity and Infrastructure Security Agency CISA
T
The Exploit Database - CXSecurity.com
J
Java Code Geeks
U
Unit 42
C
Cyber Attacks, Cyber Crime and Cyber Security
V
V2EX
C
Cisco Blogs
博客园 - 司徒正美
Project Zero
Project Zero
L
LINUX DO - 热门话题
阮一峰的网络日志
阮一峰的网络日志
Blog — PlanetScale
Blog — PlanetScale
Scott Helme
Scott Helme
A
About on SuperTechFans
Hugging Face - Blog
Hugging Face - Blog
S
Securelist
小众软件
小众软件
aimingoo的专栏
aimingoo的专栏
S
Schneier on Security
G
GRAHAM CLULEY
酷 壳 – CoolShell
酷 壳 – CoolShell
Cyberwarzone
Cyberwarzone
MongoDB | Blog
MongoDB | Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 叶小钗
T
Threatpost
Recorded Future
Recorded Future
C
CXSECURITY Database RSS Feed - CXSecurity.com
宝玉的分享
宝玉的分享
N
News and Events Feed by Topic
人人都是产品经理
人人都是产品经理
The Register - Security
The Register - Security
S
Security Archives - TechRepublic
博客园 - Franky
N
News | PayPal Newsroom
Simon Willison's Weblog
Simon Willison's Weblog
S
SegmentFault 最新的问题
W
WeLiveSecurity
A
Arctic Wolf
B
Blog

博客园 - 我本无名

asp.net中repeater嵌套CheckBoxList,RadioButtonList来完成投票 javascript中setTimeOut 和setInterval的区别 在不同页面之间传递参数 循环不间断显示滚动图片 解决"当前命令发生了严重错误。应放弃任何可能产生的结果。"的问题 - 我本无名 - 博客园 一个不错的,JavaScript代码,显示首页图片幻灯片效果 asp.net上传图片后,在图片上加入自己的背景字 - 我本无名 - 博客园 解决javascript里的中文信息是乱码的问题 javascript特效,信息滚动效果 关于水晶报表的多表显示 水晶报表的使用(VS2003+CR9) 关于“响应在此上下文中不可用” 中文VS2008中安装ASP.NET MVC框架,不显示模板 关于split中字符串的问题 OnClientClick的妙用! 一条SQL语句 如何进行软件需求分析 软件需求分析规格说明书格式 (转载)悟透JavaScript
一个计算数值并进行排序的SQL语句
我本无名 · 2008-07-11 · via 博客园 - 我本无名

有一个表
FId      ChannelID    ContentID    DataTimes    Nums
1          1              1        2008-7-11      10
2          1              1        2008-7-10      11
3          1              2        2008-7-10      8
4          1              2        2008-7-11      10
这里面FID自增ID,ChannelID是频道号,ContentID是新闻ID    DataTimes是日期  Nums是访问数
我现在想对它进行统计。
就是得到这个表里,新闻访问量,前10的信息。这里有一点就是要把不同日期的相同ContentID的信息进行相加
显示的结果应该是

Fid      ChannelID    ContentID    Nums
1          1              1          21
3         1              2          18

SELECT TOP 10 MIN(FID) as a, ChannelID,ContentID, SUM(Num) as b 
FROM cms_Stat where 
 
GROUP BY ChannelID,ContentID ORDER BY SUM(Num) DESC