ALTER PROCEDURE [dbo].[K_RT_GetProdutstogrid]
@branch int
AS
BEGIN
SET NOCOUNT ON;
select PS.sno, PD.productname,sum(PS.quantity) as quantity,PS.description from
K_RT_PurchaseDet PS
inner join K_RT_ProductDetails PD on PD.sno=PS.product where [email protected]
and [email protected] and [email protected]
group by PS.quantity,PS.sno, PD.productname,PS.description
END
如何總結數量時,公司和modelno相同如何根據條件來獲得列的總和
我的意思是有與同一公司和型號的2行沒有如何總計數量 –
您的公司和modelno在您的輸入參數中位於何處?從哪裏來? –