Need a detailed software report

Need a detailed software report

I am trying to get a software report that provides me the following information.
1. Software title (I actually only need this report for one particular peice of software)
2. Software version (there are several version installed on our network)
3. Workstation software is installed (just the asset name)
4. Requester/technician workstation is assigned to
5. A distinct count of installations. (meaning if I as a tech had 4 computers and this peice of software is installed in each computer, I want it to only count as one count, but also display all the know installations)
6. Grouped by requester/technician
 
I had one of our DBA's generate a SQL query but it will not run in the query editor. I get the error of " java.lang.Exception: Only select queries can be executed - "
Below is the SQL query he wrote.
 
  1. WITH     WORK_STATIONS(NAME,WORKSTATIONID,WORKSTATION_NAME)
  2.           AS (SELECT    u.FIRST_NAME
  3.                        ,ro.RESOURCEID AS WORKSTATIONID
  4.                        ,r.RESOURCENAME AS WORKSTATION_NAME
  5.               FROM      dbo.ResourceOwner AS ro
  6.               INNER JOIN dbo.Resources AS r
  7.               ON        ro.RESOURCEID = r.RESOURCEID
  8.               INNER JOIN dbo.AaaUser AS u
  9.               ON        ro.USERID = u.[USER_ID]
  10.               WHERE     USERID IS NOT NULL),
  11.         SOFTWARE(SOFTWARENAME,SOFTWAREVERSION,WORKSTATIONID)
  12.           AS (SELECT    'SnagIt' AS SOFTWARENAME
  13.                        ,SOFTWARENAME
  14.                        ,WORKSTATIONID
  15.               FROM      dbo.SoftwareList AS sl
  16.               INNER JOIN dbo.SoftwareInfo AS si
  17.               ON        sl.SOFTWAREID = si.SOFTWAREID
  18.               WHERE     SOFTWARENAME LIKE '%SnagIt%')
  19.     SELECT  SOFTWARENAME
  20.            ,COUNT(DISTINCT NAME) AS SNAGIT_USERS
  21.     FROM    WORK_STATIONS AS ws
  22.     INNER JOIN SOFTWARE AS s
  23.     ON      ws.WORKSTATIONID = s.WORKSTATIONID
  24.     GROUP BY SOFTWARENAME ;

                  New to ADSelfService Plus?