Avatar of maximus81
maximus81
Flag for United States of America asked on

Want to get a count of software installed using a mysql query

Here is the query I have:

SELECT
sys_sw_software.software_name,
sys_sw_software.software_version
FROM
sys_sw_software, system
WHERE sys_sw_software.timestamp = system.timestamp
AND sys_sw_software.software_name LIKE '%Cisco% %Agent%'

This will list all the Cisco Agent software but I want to get a count of them for each version. We have three different versions installed and I want to get a count of each. I tried this query but it never gives me all the versions.

SELECT COUNT(DISTINCT system.system_id) AS
software_count,
sys_sw_software.software_name,
sys_sw_software.software_version,
sys_sw_software.software_publisher

FROM sys_sw_software, system

WHERE sys_sw_software.timestamp = system.timestamp
AND software_comment NOT LIKE 'Update'
AND software_comment NOT LIKE 'codec'
AND software_comment NOT LIKE 'odbc driver'
AND software_name NOT LIKE ''
AND software_name LIKE '%cisco%'
GROUP BY sys_sw_software.software_name
ORDER BY sys_sw_software.software_name
MySQL Server

Avatar of undefined
Last Comment
maximus81

8/22/2022 - Mon
Gerwin Jansen

What error do you get? I would think that you have to group by sys_sw_software.software_version and sys_sw_software.software_publisher as well (besides only sys_sw_software.software_name that you have now.
ASKER CERTIFIED SOLUTION
Ron Malmstead

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
maximus81

ASKER
This gets me close to what i want

SELECT
sys_sw_software.software_name,
sys_sw_software.software_version
FROM
sys_sw_software, system
WHERE sys_sw_software.timestamp = system.timestamp
AND sys_sw_software.software_name LIKE '%Cisco% %Agent%'
GROUP BY sys_sw_software.software_version

This lists out:

Cisco Agent Desktop       71.0.22
Cisco Agent Desktop       85.1.214
Cisco Agent Desktop       85.1.312

I would like to get a count of each of them.
maximus81

ASKER
I figured this out. This is what I used.

SELECT COUNT(DISTINCT system.system_id) AS
software_count,
sys_sw_software.software_name,
sys_sw_software.software_version
FROM
sys_sw_software, system
WHERE sys_sw_software.timestamp = system.timestamp
AND sys_sw_software.software_name LIKE '%Microsoft Office Standard%'
GROUP BY sys_sw_software.software_version
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy