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

推荐订阅源

Microsoft Security Blog
Microsoft Security Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Know Your Adversary
Know Your Adversary
I
Intezer
Security Latest
Security Latest
C
Cyber Attacks, Cyber Crime and Cyber Security
NISL@THU
NISL@THU
P
Palo Alto Networks Blog
S
Schneier on Security
AWS News Blog
AWS News Blog
T
Threat Research - Cisco Blogs
T
The Exploit Database - CXSecurity.com
L
Lohrmann on Cybersecurity
A
Arctic Wolf
Hacker News - Newest:
Hacker News - Newest: "LLM"
TaoSecurity Blog
TaoSecurity Blog
T
Tenable Blog
C
Cisco Blogs
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
H
Heimdal Security Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
S
Secure Thoughts
The Hacker News
The Hacker News
T
Troy Hunt's Blog
C
CERT Recently Published Vulnerability Notes
PCI Perspectives
PCI Perspectives
B
Blog RSS Feed
B
Blog
The GitHub Blog
The GitHub Blog
P
Privacy & Cybersecurity Law Blog
L
LINUX DO - 热门话题
P
Proofpoint News Feed
C
Cybersecurity and Infrastructure Security Agency CISA
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Google DeepMind News
Google DeepMind News
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
Threatpost
V
V2EX
J
Java Code Geeks
T
Tor Project blog
Microsoft Azure Blog
Microsoft Azure Blog
Scott Helme
Scott Helme
S
Security @ Cisco Blogs
月光博客
月光博客
Cisco Talos Blog
Cisco Talos Blog
I
InfoQ
博客园 - Franky
MongoDB | Blog
MongoDB | Blog
AI
AI

博客园 - 大熊(BigBear)

ADO.net实现批量SQL操作. - 大熊(BigBear) - 博客园 Application_AcquireRequestState事件,导致Ajax客户端不能加载 CSLA.Net在Web项目中使用SQL2005的分页 Moss中Form验证中"找不到匹配项"问题的处理 对于知识库系统建设的思考 知识管理中知识地图详解〔转〕 知识管理中的一些概念 Aop面向方面编程之PostSharp框架 [摘]IIS上部署WCF的问题 Silverlight表格绑定中的一点细节处理 页面加载性能的优化 由一棵树绑定引发的遐想 IBatis.Net使用MemCached替换内置缓存策略 .Net下调用Java安全Web服务 Webpart深入(二) Webpart深入(一) ASP.NET MVC 中文文档3 ASP.NET MVC 中文文档2 ASP.net MVC 中文文档1
Linq使用之分组
大熊(BigBear) · 2009-11-25 · via 博客园 - 大熊(BigBear)

通常,用Linq分组的时候,Group by都会有一个字段, 但遇到如下语句时,怎么写呢?

select sum(colmA), sum(colmB) from TableA

没有Group by, 但Linq中是不能缺少的. 后来发现, 写成一个常量就搞定了.

var result = from r in tableA
                 group r by 1 int g
                select new ClassB
                {
                  PropertyA = g.Sum(r => r.colmA),
                  ProperyB =  g.Sum(r => r.colmB)
                 }

关键就是by 1 ,数字1.