ถ้าเราจะตรวจสอบค่าซ้ำต้องเขียนยังไงครับ
ถ้าจะบอกว่า RP เดียวกัน items เดียวกัน เราจะใช้ Line No = 10000
แบบนี้ต้องเขียน case when ยังไงครับ
Code: Select all
SELECT [Prod_ Order No_]
,[Item No_]
,[Line No_]
,sum([Add Round Before (Print)]) as [Add Round Before (Print)]
,sum([Add Round After (Print)]) as [Add Round After (Print)]
,sum([Round Print]) as [Round Print]
,sum([Add Round Before (Print)] + [Add Round After (Print)] + [Round Print]) as [Total Round Print]
,[No_ of Cut Size]
,[No_ of Work]
FROM [_PROD].[dbo].[$Prod_ Order Component]
where [Location Code] in ('PAPER') and [Prod_ Order No_] ='RP21040211'
group by [Prod_ Order No_],[Item No_],[No_ of Cut Size],[No_ of Work],[Line No_]
2021-05-20_11-58-45.jpg
2021-05-20_11-58-451.jpg
You do not have the required permissions to view the files attached to this post.