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

推荐订阅源

Attack and Defense Labs
Attack and Defense Labs
T
Threatpost
C
Cybersecurity and Infrastructure Security Agency CISA
H
Hackread – Cybersecurity News, Data Breaches, AI and More
I
Intezer
C
Cyber Attacks, Cyber Crime and Cyber Security
The Register - Security
The Register - Security
量子位
Security Latest
Security Latest
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
大猫的无限游戏
大猫的无限游戏
小众软件
小众软件
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
C
CXSECURITY Database RSS Feed - CXSecurity.com
MyScale Blog
MyScale Blog
J
Java Code Geeks
Apple Machine Learning Research
Apple Machine Learning Research
Google DeepMind News
Google DeepMind News
WordPress大学
WordPress大学
Spread Privacy
Spread Privacy
Jina AI
Jina AI
博客园 - 【当耐特】
P
Palo Alto Networks Blog
Last Week in AI
Last Week in AI
SecWiki News
SecWiki News
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
G
GRAHAM CLULEY
宝玉的分享
宝玉的分享
Hacker News - Newest:
Hacker News - Newest: "LLM"
T
The Blog of Author Tim Ferriss
V
Vulnerabilities – Threatpost
有赞技术团队
有赞技术团队
T
Tor Project blog
H
Hacker News: Front Page
A
Arctic Wolf
NISL@THU
NISL@THU
A
About on SuperTechFans
云风的 BLOG
云风的 BLOG
Engineering at Meta
Engineering at Meta
V
V2EX
N
News and Events Feed by Topic
Webroot Blog
Webroot Blog
Know Your Adversary
Know Your Adversary
P
Privacy International News Feed
I
InfoQ
D
Docker
L
LINUX DO - 最新话题
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
U
Unit 42

博客园 - 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-06-02 · via 博客园 - prayforsmile

set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go


ALTER PROCEDURE [dbo].[Rpts_GetGoldIndentOrdersInfo]
 -- Add the parameters for the stored procedure here
 @IndetOrdNum varchar(50)='',
 @IsAmount varchar='1'
AS
BEGIN


SELECT
g.Pm_Id
,Amount_All=SUM(g.Amount_All)
,g.Weight_All
,ReMark=replace(replace(ISNULL(g.ReMark,''),char(10),''),char(13),'')
,p.PNumber,p.Name,p.StylePic,p.StorageCount  INTO #INFO
from dbo.GoldIndentOrdersInfo as g
inner join dbo.GoldIndentOrders as a on a.Gi_Id=g.Gi_Id
inner join dbo.ProductModelInfo as p on p.Pm_Id=g.Pm_Id
where a.IndetOrdNum=@IndetOrdNum and
((@IsAmount='1' and p.StorageCount>0) or
 (@IsAmount='0' and p.StorageCount=0) or
  @IsAmount='2')
GROUP BY
g.Pm_Id,g.Weight_All
,replace(replace(ISNULL(g.ReMark,''),char(10),''),char(13),'')
,p.PNumber,p.Name,p.StylePic,p.StorageCount


SELECT * INTO #A_W_INFO
FROM
(
 SELECT DISTINCT
 Pm_Id
 FROM
 (
  SELECT *
  FROM #INFO
 ) AS V
)V OUTER APPLY(
SELECT
Out_Sum_W= STUFF(REPLACE(REPLACE(
 (
  SELECT Out_Sum_W= cast(Amount_All as varchar) + '*' +  cast(cast(Weight_All as float) as varchar)+'g' + CASE WHEN ReMark='' THEN '' ELSE '['+ReMark+']' END
  FROM      
  (
   SELECT *
   FROM #INFO
  ) AS VV
  WHERE VV.Pm_Id = V.Pm_Id
  FOR XML AUTO
 ), '<VV Out_Sum_W="', ';'), '"/>', ''), 1, 1, '')
)N1

SELECT
A.*
,B.Out_Sum_W
,ROW_NUMBER() OVER (ORDER BY A.PNumber) AS ROW_INDEX
FROM
(
SELECT DISTINCT
A.Pm_Id
,A.PNumber,A.Name,A.StylePic,A.StorageCount
FROM #INFO A
)AS A
INNER JOIN #A_W_INFO B ON B.Pm_Id=A.Pm_Id


  
--   select g.Pm_Id,g.Amount_All,g.Weight_All,g.ReMark,
--    p.PNumber,p.Name,p.StylePic,p.StorageCount,
--    ROW_NUMBER() OVER (ORDER BY g.Gi_Id) AS ROW_INDEX
--   from dbo.GoldIndentOrdersInfo as g
--   inner join dbo.GoldIndentOrders as a on a.Gi_Id=g.Gi_Id
--   inner join dbo.ProductModelInfo as p on p.Pm_Id=g.Pm_Id
--   where a.IndetOrdNum=@IndetOrdNum and
--   ((@IsAmount='1' and p.StorageCount>0) or
--    (@IsAmount='0' and p.StorageCount=0) or
--     @IsAmount='2')
   

END