我有2個查詢得到總和,我想將它們合併成一個單一的選擇查詢如果可能的話指出他們在那裏條款不同的字段名。從2 SQL返回單金額查詢
SELECT ISNULL(SUM(Stocking_Count), 0)
FROM Fish_Stocking
WHERE fish_id = 'B2017-1'
AND tank_id = 'H A01'
AND Date_Assigned = '2017-02-02'
AND stocking_date <= '2017-03-28'
SELECT ISNULL(SUM(NO_FISH_SWUM_OFF), 0)
FROM Swim_Thru
WHERE Dest_fish_id = 'B2017-1'
AND Dest_tank_id = 'H A01'
AND Dest_Date_Assigned = '2017-02-02'
AND date_swim_thru <= '2017-03-28'
提示:'UNION ALL'。 –
你可以檢查我的下面的工作答案.. – Aruna