This will give you the count you're looking for. Definitely install the SDK and try out the SWQL Studio application if you haven't already. That makes finding these things much easier.
SELECT aa.Template.Name, COUNT(1) AS Qty FROM Orion.APM.Application aa GROUP BY aa.Template.Name
Steven W. Klassen
Programmer Analyst @ Loop1 Systems
1 of 1 people found this helpful
This is good ☺
In the meantime I also came across the APM_application and came up with a query that does the same but joins the nodes table (which is a bit useless because I am simply doing a count):
select count(b.dns), a.name
from APM_Application a
inner join nodes b
on a.nodeid = b.NodeID
group by a.name;
So yours in fact more efficient.