Home Forums SQL Server 2012 SQL Server 2012 - T-SQL aggregate function in subquery RE: aggregate function in subquery
drew.allen
SSC Guru
Points: 76944
More actions
July 13, 2016 at 8:16 am
#1889867
You can place your CASE expression in a CTE, derived table, or CROSS/OUTER APPLY and then do the SUM in the main query.
Drew
J. Drew AllenBusiness Intelligence AnalystPhiladelphia, PA