我有一個存儲過程,我希望它返回以下...返回兩個COUNT(*)的結果中選擇一個
TotalItems | FailedItems
@totalItems | @failedItems
where --> @totalItems = `SELECT COUNT(*)
From dbo.OdsBuild AS P
where P.StartTime Between @StartDate and @EndDate
AND P.Official = 1`
where --> @failedItems = `SELECT COUNT(*)
From dbo.Items AS P
where p.StartTime Between @StartDate and @EndDate
AND P.Official = 1 AND (P.Result = 7 OR P.Result = 8 OR P.Result = 14)`