SQL Query : For Summarizing Software Metering Usage

The first query brings back separate rows for each line in V_MonthlyUsageSummary view. Second query consolidates it to one row and totals some of the fields. /****** Software Metering – Multiple Rows  ******/ SELECT MRT.ProductName, VRS.Name0, MUR.FullName, MFS.MeteredFileName, MUS.UsageCount, MUS.UsageTime, MUS.LastUsage, MUS.TimeKey AS FirstUsed FROM V_MonthlyUsageSummary MUS JOIN v_R_System VRS ON MUS.ResourceID = VRS.ResourceID JOIN v_MeteredUser MUR ON MUS.MeteredUserID = MUR.MeteredUserID JOIN v_MeteredFiles MFS ON MUS.FileID = MFS.MeteredFileID JOIN MeterRules MRT ON MRT.RuleID = MFS.RuleID WHERE MRT.ProductName = ‘metering rule name’ And (VRS.operatingSystem0 like ‘Windows 7%’ OR VRS.operatingSystem0 like ‘Windows…

Read More