日期:2014-05-18 浏览次数:20763 次
INSERT INTO PorderSub(LineID,PorderID,ProductID,ProductSN,ProductCode,ProductName,Spec,Manufactory,ApprovalID,InsuranceID,PackRate1,PackRate2,ConvertRate, RequestQuantity,RequestPrice,RequestAmount,Quantity,Price,Amount,Remark) Select ROW_NUMBER() OVER(ORDER BY ProductID),PorderID,ProductID,ProductSN,ProductCode,ProductName,Spec,Manufactory,ApprovalID,InsuranceID,PackRate1,PackRate2,ConvertRate, SUM(RequestQuantity),RequestPrice,SUM(RequestAmount),SUM(Quantity),Price,SUM(Amount),Remark From #PorderSub Group By ProductID,PorderID,ProductSN,ProductCode,ProductName,Spec,Manufactory,InsuranceID,PackRate1,PackRate2,ConvertRate,RequestPrice,Price,Remark
你漏了 INTO PorderSub(LineID,PorderID,ProductID,ProductSN,ProductCode,ProductName,Spec,Manufactory,ApprovalID,InsuranceID,PackRate1,PackRate2,ConvertRate, RequestQuantity,RequestPrice,RequestAmount,Quantity,Price,Amount,Remark) Select ROW_NUMBER() OVER(ORDER BY ProductID),PorderID,ProductID,ProductSN,ProductCode,ProductName,Spec,Manufactory, ApprovalID, InsuranceID,PackRate1,PackRate2,ConvertRate, SUM(RequestQuantity),RequestPrice,SUM(RequestAmount),SUM(Quantity),Price,SUM(Amount),Remark From #PorderSub Group By ProductID,PorderID,ProductSN,ProductCode,ProductName,Spec,Manufactory,ApprovalID, InsuranceID,PackRate1,PackRate2,ConvertRate,RequestPrice,Price,Remark
------解决方案--------------------
group by PorderID,ProductID,ProductSN,ProductCode,ProductName,Spec, Manufactory,ApprovalID,InsuranceID,PackRate1,PackRate2,ConvertRate,RequestPrice,Price,Remark