I am trying to run a SQL Query to see what NODES are using up what element counts in our environment.
I have 2 SQL Queries that seem to work individually, but when I combine them, they have the same information.
I referred to this article: Looking for a SQL script for elements per node
He has the queries individually and they seem to work individually, but when I combine them into 1 query, I not getting the same node information.
Eventually, I am gong to add the Total Element count for each NODE to the script, but I need this 1st.
Interfaces:
select Nodes.Caption, Nodes.N01_NODE_TYPE, IP_Address, Count(*) As Interfaces from Nodes
inner join Interfaces on Interfaces.NodeID = Nodes.NodeID
group by Nodes.Caption, Nodes.N01_NODE_TYPE, IP_Address
Volumes:
select Nodes.Caption, Nodes.N01_NODE_TYPE, IP_Address, Count(*) As Volumes from Nodes
inner join Volumes on Volumes.NodeID = Nodes.NodeID
group by Nodes.Caption, Nodes.N01_NODE_TYPE, IP_Address
Combined:
select Nodes.Caption, Nodes.N01_NODE_TYPE, IP_Address, Count(*) As Interfaces, Count(*) As Volumes from Nodes
inner join Interfaces on Interfaces.NodeID = Nodes.NodeID
inner join Volumes on Volumes.NodeID = Nodes.NodeID
group by Nodes.Caption, Nodes.N01_NODE_TYPE, IP_Address
What am i missing here?

When I run the query on a single specific node, i get different volume/interface totals like Id expect to.
