Include smart labels on custom report output
Is there anyway that I can have the output of a report include any smart labels that have been applied to a machine? I have a report that runs to locate specific software and then return the computer name and IP address. It works great, but being able to include the smart labels would be exactly what I need. Any help is greatly appreciated.
Community Chosen Answer
This would work.
SELECT DISTINCT M.NAME, IP, GROUP_CONCAT(DISTINCT L.NAME SEPARATOR '\n') AS LABEL_NAME FROM MACHINE M LEFT JOIN MACHINE_LABEL_JT ON M.ID = MACHINE_LABEL_JT.MACHINE_ID LEFT JOIN LABEL L ON MACHINE_LABEL_JT.LABEL_ID = L.ID GROUP BY M.NAME ORDER BY M.NAME