cmsinformatica / zabbix

0 stars 0 forks source link

Select distinct #2

Open cmsinformatica opened 1 year ago

cmsinformatica commented 1 year ago

SELECT DISTINCT host, t.description, f.triggerid, e.acknowledged, t.value FROM triggers t INNER JOIN functions f ON ( f.triggerid = t.triggerid ) INNER JOIN items i ON ( i.itemid = f.itemid ) INNER JOIN hosts ON ( i.hostid = hosts.hostid ) INNER JOIN events e ON ( e.objectid = t.triggerid ) WHERE (e.eventid DIV 100000000000000) IN (0) AND (e.object-0)=0 AND hosts.status =0 AND i.status =0 AND t.status =0 GROUP BY f.triggerid ORDER BY t.lastchange DESC