我有以下查询:
--Total DLs--
select sum(DLs) as DLs_Total
From
(
Select
Count(T.Create_Dtime) As Dls
From Player_Tapjoy T
Inner Join Player P On T.Player_Id=P.Player_Id
Where P.ReferredBy IS NULL
Union All
Select
Count(Pt.Create_Dtime) As DLs
From Player_Aux_Pt Pt
Inner Join Player P On Pt.Player_Id=P.Player_Id
Where
Pt.Site = 'AppCircle'
And P.ReferredBy IS NULL
)
我将运行此报告两次,一次用于“And P.ReferredBy is Null”,一次用于“And P.ReferredBy is NOT Null”。
我觉得这可能是切换到案例查询的好时机......所以如果在 null 或非 null 的情况下,一个查询会产生两个单独的结果?