Can this query be improved? view for few count totals on a table I am not a dba but I am trying to create an effecient query for a view that will return some totals on a table

select 
 (select count(1) from alerts) as Total,
 (select count(1) from alerts where iscomplete is null or iscomplete = 0) as Active,
 (select count(1) from alerts where iscomplete = 1) as Complete
Use CASE so that only one full scan is needed. An non-clustered index on iscomplete will cover this query.

SELECT
      COUNT(1) AS Total
    , SUM(CASE WHEN iscomplete is null or iscomplete = 0 THEN 1 ELSE 0 END) AS Active
    , SUM(CASE WHEN iscomplete = 1 THEN 1 ELSE 0 END) AS Complete
FROM dbo.alerts;