Tested in build PGSQL (14300) and MSSQL (14306)
SELECT reqtl.TEMPLATENAME "Request Template",
count(wo.WORKORDERID) "Request Count",
count(case when std.ispending='0' THEN 1 ELSE NULL END) "Completed",
count(case when std.ispending='1' THEN 1 ELSE NULL END) "Pending"
FROM WorkOrder wo
LEFT JOIN RequestTemplate_list reqtl ON wo.TEMPLATEID=reqtl.TEMPLATEID
LEFT JOIN WorkOrderStates wos ON wo.WORKORDERID=wos.WORKORDERID
LEFT JOIN StatusDefinition std ON wos.STATUSID=std.STATUSID
where reqtl.TEMPLATENAME='New site planning'
group by reqtl.TEMPLATENAME,reqtl.templateid