私が現在持っているものは:
COUNT DETAILS:
CNT DTLID COUNT TOTAL QTY UNITPRICE AMOUNT
1 234 2222 1.20 32
1 12 123 2 21
What i want it to be like
CNT DTLID COUNT TOTAL QTY UNITPRICE AMOUNT
1 234,12 2222 , 123 1.20,2 32 + 21 = 53
カンマ区切りの値が必要で、金額列にgroupby句を使用したい。
現在私がしていることは次のとおりです。
ALTER PROCEDURE [dbo].[sp_Tbl_CountDetail_SelectAll]
-- Add the parameters for the stored procedure here
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
select * from Tbl_CountDetail
inner join tbl_Contract
on
tbl_CountDetail.ContractID = tbl_Contract.ContractID
inner join tbl_Count
on
tbl_CountDetail.CountID = tbl_Count.CountID
where tbl_CountDetail.isDeleted = 0
and tbl_Contract.isdeleted = 0
END