Any assistance with merging the following two select queries would be greatly appreciated.
- The first query returns 1000 rows
- The second query returns 1000 rows.
- RSV.ResourceID is the primary key
- RSV.ResourceID by itself outputs 14,000 rows.
The end goal is to output all 14,000 rows for RSV.ResourceID and have it include a column with results for GBU.BrowserName0 and a column with results for GLD.Size0.
Select RSV.ResourceID, GBU.BrowserName0
From (
select ResourceID,
max(GBU.UsagePercentage0) as UsagePercentage0
from
v_GS_BROWSER_USAGE GBU
WHERE
GBU.UsagePercentage0 > 0
group by ResourceID)
as s
INNER JOIN v_GS_BROWSER_USAGE GBU on (GBU.Resourceid = s.ResourceID and GBU.UsagePercentage0 = s.UsagePercentage0)
RIGHT OUTER JOIN v_R_System_Valid RSV on GBU.Resourceid = RSV.ResourceID
___________________________________________
Select RSV.ResourceID, GLD.Size0
From (select ResourceID,
max(gld.deviceid0) as deviceid0
from
v_GS_LOGICAL_DISK GLD
WHERE gld.deviceid0='C:'
group by ResourceID)
as d
INNER JOIN v_GS_LOGICAL_DISK GLD on (GLD.Resourceid = d.ResourceID and GLD.deviceid0 = d.deviceid0)
RIGHT OUTER JOIN v_R_System_Valid RSV on GLD.ResourceID = RSV.ResourceID