我有一个存储过程,我在其中加入了两个查询。我的查询是
alter PROCEDURE test
@SDate datetime,
@EDate datetime
作为
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Insert statements for procedure here
(Select count(quoteid) as TotalQuote, sum(totalamount) as QuoteAmount from dbo.QuoteBase
where CreatedOn BETWEEN @SDate AND @EDate)
union All
(select count(salesorderid)as TotalOrders, sum(totalamount) as OrderAmount from dbo.SalesOrderBase Where
CreatedOn BETWEEN @SDate AND @EDate)
我得到了列
Total Quote Quote Amount
17 700
118 5000
但我想要这样的结果
Total Quote Quote Amount Total Orders Order Amount
17 700 118 5000
如果有人有想法请与我分享