SQL Sub Query
Posted on 2013-06-21
Easy one for you lot I am sure..
I am super inexperienced with this sql, and as a result, for this sort of query I would create a separate tmp table at the start, and count that tmp table when calculating results. I know that is an inefficient way of doing it so would like to utilize the sub query. Could somebody please correct the following for me?
SUM(OutstandingReserves) AS [OutstandingReserves],
SUM(Payments) AS [Payments],
SUM(TotalIncurred) AS [TotalIncurred],
SUM(NotificationsMTD) AS [NotificationsMTD],
COUNT (ClaimNumber) WHERE
(SELECT ClaimNumber WHERE Status IN ('open','reopened')