This is what I'm trying to accomplish:
Create a custom query resource where I have a list of nodes that display the current value from a Custom Poller (Sounds easy to me, but I'm NOT a SQL guy)
After much trial and error, I'm off and on getting closer, but it's still no good. Here is what I currently have:
SELECT n.displayname, p.CurrentValue
FROM Orion.NPM.CustomPollerAssignmentOnNode AS p, Orion.Nodes AS n, Orion.NodesCustomProperties AS c
WHERE c.UPS_TEMP_PROBE = 'TRUE' AND p.CustomPollerName='RoomTempCelsius' AND n.displayname LIKE '%UPS%';
Instead of a list of about 50 (The total of Nodes where c.UPS_TEMP_PROBE = 'TRUE' is a true statement), I get 270k results with each node having hundreds of different results. Before I added AND n.displayname LIKE '%UPS% I was getting 6+ million results.
I have had no success trying to create a useful JOIN statement (I spent over a full day trying that). I thought I could somehow find the name of the node in a table and join that data to requested data from the other tables I would be good to go, but with each table having it's own 'displayname' column with different data that was unusable, and for some reason I was getting multiple results for each node when I tried to sort by NodeID, and It seems DISTINCT is not supported.
Anyone help a newbie out?