我有一个使用union all
的SQL查询。当我运行以下查询时,只返回一行NULL
值的行(该值为null,因为该时间段没有数据)。期望是返回2行null。是什么给了什么?
SELECT
SUM(val) AS GA
FROM
mytable
WHERE region = 'someRegion'
AND ACTIVITY_MTH BETWEEN '2014-04-01' AND '2014-04-30'
UNION
ALL
SELECT
quota
FROM
budgetTable
WHERE sales_id = 'someRegion'
AND start_date = '2014-04-01'
AND metric_id = 1