I am trying to produce the following in SWQL. I can do this in SQL (report writer) but I want to do it in SWQL.
TOTAL UP DOWN UNMANAGED OTHER
89 79 0 10 0
My SQL query looks like this:
SELECT Count(*) as Total,
(SELECT Count(*) FROM Nodes Where Status = 1 ) as 'UP',
(SELECT Count(*) FROM Nodes Where Status = 2 ) as 'DOWN',
(SELECT Count(*) FROM Nodes Where Status = 9 ) as 'UNMANAGED',
(SELECT Count(*) FROM Nodes Where Status not in (1,2,9) ) as 'OTHER'
FROM Nodes
I know I have to convert to using SWQL nomenclature so this works:
SELECT Count(*) AS Total FROM Orion.Nodes
or
SELECT Count(*) AS Up FROM Orion.Nodes Where Status = 1
etc.
But I want to nest these together, using SWQL, like this:
SELECT Count(*) as TOTAL FROM Orion.Nodes
(SELECT Count(*) as UP FROM Nodes Where Status = 1),
(SELECT Count(*) as DOWN FROM Nodes Where Status = 2),
(SELECT Count(*) as UNMANAGED FROM Nodes Where Status = 9),
(SELECT Count(*) as OTHER FROM Nodes Where Status not in (1,2,9)
Any ideas?