I had submitted this before:
I'm running SNMP Zenoss connected to mysql database.I'm trying to select the device that fails the most from the
database.
Column name called "devices" has all the device names.
Column name called "events" has all the events that are generated.
How can i write a query that will display the device that fails the most in a month?
petrosky suggested the below query:
SELECT Devices, SUM(`Events`) AS Total FROM devices
GROUP BY Devices
ORDER BY Total DESC LIMIT 1
The above query works and displays the device that fails the most.
What I also need is that it should display the event from the "events" column.
Please help and thanks in advance.
I'm running SNMP Zenoss connected to mysql database.I'm trying to select the device that fails the most from the
database.
Column name called "devices" has all the device names.
Column name called "events" has all the events that are generated.
How can i write a query that will display the device that fails the most in a month?
petrosky suggested the below query:
SELECT Devices, SUM(`Events`) AS Total FROM devices
GROUP BY Devices
ORDER BY Total DESC LIMIT 1
The above query works and displays the device that fails the most.
What I also need is that it should display the event from the "events" column.
Please help and thanks in advance.