我目前拥有的是:
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
我想有逗号分隔的值,也想对金额列使用分组子句。
目前我要做的是:
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