-2
select ID_Sale,SaleDate,Branch_Name,P_Name,P_UnitPrice,QuantitySold,
sum (QuantitySold*P_UnitPrice) over (order by ID_Sale asc) AS RunningTotal
from tblP_Sales
INNER JOIN tblProduct_With_Img
ON tblP_Sales.P_ID_Sales = tblProduct_With_Img.P_ID
INNER JOIN tblBranches
ON tblP_Sales.BranchID = tblBranches.BranchID
--this group is not working ? how to work this ?
group by P_Name
これはGROUP BY
句なしの結果である:クエリを名前でグループ化するにはどうすればいいですか? P_NAME
Sale_ID Sale_Date Branch Item Name Pric/unit qty RUNTotal
1056 2016-11-10 Ajman Afghani Pulaw With Meat 26 1 26
1057 2016-11-10 Ajman Sada Rice With Chicken Boti 24 2 74
1058 2016-11-11 Ajman Afghani Pulaw With Meat 26 1 100
コードのみのご質問にはお答えすることは困難です。 http://stackoverflow.com/help/how-to-ask – HoneyBadger
あなたの質問をもう少し説明してください。あなたは( 'Branch_Name'、 'P_Name'、その他)を参照していますか?可能であれば、例データを提供してください。 – sr28
同じクエリをP_Name(製品名)でグループ化してください –