/build/static/layout/Breadcrumb_cap_w.png

How to Add User Name

I'm wondering how I would go about adding the username to this report. I'd like to match it with the machine name.

SELECT DISPLAY_NAME,PUBLISHER,
GROUP_CONCAT(DISTINCT MACHINE.NAME SEPARATOR '\n') AS MACHINE_NAME_GROUPED,
GROUP_CONCAT(DISTINCT LABEL.NAME SEPARATOR '\n') AS LABEL_NAME_GROUPED,
URLINFO_ABOUT
FROM SOFTWARE
LEFT JOIN MACHINE_SOFTWARE_JT ON (MACHINE_SOFTWARE_JT.SOFTWARE_ID = SOFTWARE.ID)
LEFT JOIN MACHINE ON (MACHINE.ID = MACHINE_SOFTWARE_JT.MACHINE_ID)
LEFT JOIN SOFTWARE_LABEL_JT ON (SOFTWARE_LABEL_JT.SOFTWARE_ID = SOFTWARE.ID)
LEFT JOIN LABEL ON (LABEL.ID = SOFTWARE_LABEL_JT.LABEL_ID)
WHERE (NOT SOFTWARE.IS_PATCH) AND ((MACHINE.NAME is not null) AND (LABEL.NAME is null))
GROUP BY SOFTWARE.ID
ORDER BY DISPLAY_NAME,MACHINE_NAME_GROUPED

0 Comments   [ + ] Show comments

Answers (2)

Posted by: scottlutz 12 years ago
Orange Senior Belt
0
Tayana,

Since you are already pulling from the machine table, you should just be able to add MACHINE.USER to your select, since it also lives in there.
Posted by: GillySpy 12 years ago
7th Degree Black Belt
0
What you want could be in MACHINE.USER, MACHINE.USER_FULLNAME, MACHINE.USER_LOGGED, MACHINE.USER_NAME

But since you are grouping on machines the MACHINE_NAME_GROUPED contains a list of machines. How would you want to show users? How are you expecting to match them up ?

You might be able to use:
SELECT DISPLAY_NAME,PUBLISHER,
GROUP_CONCAT(DISTINCT MACHINE.NAME ORDER BY MACHINE.ID SEPARATOR '\n' ) AS MACHINE_NAME_GROUPED,
GROUP_CONCAT(DISTINCT MACHINE.USER_LOGGED ORDER BY MACHINE.ID SEPARATOR '\n' ) AS USER_NAME_GROUPED,
GROUP_CONCAT(DISTINCT LABEL.NAME SEPARATOR '\n') AS LABEL_NAME_GROUPED,
...


But there is no guarantee the user names will line up because of missing names or same user on more than one machine, etc
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ