→ 🚀What's New? Join Us for the Fall Product Launch! Register Now !
‎02-13-2019 10:11 PM
‎03-01-2019 10:08 PM
Select Top 1000000
tblSoftwareUni.softwareName As software,
tblSoftware.softwareVersion As version,
Count(tblAssets.AssetID) As Total
From tblAssets
Inner Join tblSoftware On tblAssets.AssetID = tblSoftware.AssetID
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tblSoftwareUni On tblSoftware.softID = tblSoftwareUni.SoftID
Where
--use the DATEADD(measuring by, length, from when)
tblAssets.Lastseen > DATEADD(DAY, -30, GETDATE())
--use this to check if an asset is marked active 1=active
And tblAssetCustom.State = 1
And tblSoftwareUni.softwareName Like '%java%'
Group By tblSoftwareUni.softwareName,
tblSoftware.softwareVersion
--the having clause is only necessary if you are filtering on your agregate functions
--so if you wanted something like:
--HAVING Count(tblAssets.AssetID) > 10
--^ would only show software/versions that appear more than 10 times in your ecosystem
Order By Total Desc,
software
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now