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

推荐订阅源

WordPress大学
WordPress大学
V
Visual Studio Blog
P
Privacy International News Feed
月光博客
月光博客
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
L
Lohrmann on Cybersecurity
N
News and Events Feed by Topic
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Apple Machine Learning Research
Apple Machine Learning Research
阮一峰的网络日志
阮一峰的网络日志
Webroot Blog
Webroot Blog
T
Threatpost
宝玉的分享
宝玉的分享
The Last Watchdog
The Last Watchdog
小众软件
小众软件
L
LINUX DO - 最新话题
C
Cisco Blogs
T
Troy Hunt's Blog
Schneier on Security
Schneier on Security
酷 壳 – CoolShell
酷 壳 – CoolShell
www.infosecurity-magazine.com
www.infosecurity-magazine.com
雷峰网
雷峰网
G
GRAHAM CLULEY
有赞技术团队
有赞技术团队
Know Your Adversary
Know Your Adversary
博客园 - 叶小钗
罗磊的独立博客
V
V2EX
博客园 - Franky
P
Proofpoint News Feed
SecWiki News
SecWiki News
腾讯CDC
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Jina AI
Jina AI
博客园 - 三生石上(FineUI控件)
S
Secure Thoughts
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Google DeepMind News
Google DeepMind News
Attack and Defense Labs
Attack and Defense Labs
人人都是产品经理
人人都是产品经理
The Cloudflare Blog
PCI Perspectives
PCI Perspectives
V2EX - 技术
V2EX - 技术
Google DeepMind News
Google DeepMind News
Last Week in AI
Last Week in AI
aimingoo的专栏
aimingoo的专栏
Cisco Talos Blog
Cisco Talos Blog
N
News and Events Feed by Topic
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
S
SegmentFault 最新的问题

博客园 - prayforsmile

向android虚拟机中push文件提示Read-only file system 存储 =iif(RowNumber("table6_Group3")=1,"Solid","None") - prayforsmile - 博客园 StringSplitToTable SP 拼音 临时表 调用另一个存储过程 返回主键 时间 sp数组处理 同一个表取取相同列内容剔除,附加 1 SP插入 rrr 再见吧,09 ddl - prayforsmile - 博客园 ~~ 关于Case项目 2009悲剧男
时间对应多条记录
prayforsmile · 2010-11-17 · via 博客园 - prayforsmile

时间对应多条记录

SELECT
A.*
,B.TotalWeight
,B.TotalMoney
FROM
(
 SELECT
 CONVERT(varchar(10),A.AccountDt,120) AS AccountDt
 ,A.[NetWeight]
 ,A.[Fee]
 FROM [BtProduceManage].[dbo].[Tst_Material] as A
 inner join Bse_Depart AS B ON B.Dept_Id=A.Dept_Id
 where  DATEDIFF(DAY,A.AccountDt,@strDtSt)<=0
   AND DATEDIFF(DAY,A.AccountDt,@strDtEd)>=0
   AND A.[State]=1
   AND A.[Material_Type]=3
   AND B.Fy_Id=@strFy
 group by
 A.[NetWeight]
 ,A.[Fee]
 ,CONVERT(varchar(10),A.AccountDt,120)
) AS A
INNER JOIN
(
 SELECT
 CONVERT(varchar(10),A.AccountDt,120) AS AccountDt
 ,SUM(A.[NetWeight]) AS TotalWeight
 ,SUM(A.[Fee]*A.[NetWeight]) AS TotalMoney
 FROM [BtProduceManage].[dbo].[Tst_Material] as A
 inner join Bse_Depart AS B ON B.Dept_Id=A.Dept_Id
 where  DATEDIFF(DAY,A.AccountDt,@strDtSt)<=0
   AND DATEDIFF(DAY,A.AccountDt,@strDtEd)>=0
   AND A.[State]=1
   AND A.[Material_Type]=3
   AND B.Fy_Id=@strFy
 group by
 CONVERT(varchar(10),A.AccountDt,120)
) AS B ON B.AccountDt=A.AccountDt
ORDER BY
A.AccountDT ASC

posted on 2010-11-17 14:11  prayforsmile  阅读(192)  评论()    收藏  举报