with cteFilteredSize as (
    SELECT d.[Server Name]
        ,sum(d.[UsedSpaceMB]) as filteredInstanceMBUsed
        FROM [dbo].[octpdba-931-detail] [d]
    WHERE d.[toIgnore]=0
    GROUP BY d.[server Name]
)
,cteUnfilteredSize as (
    SELECT d.[Server Name]
        ,sum(d.[UsedSpaceMB]) as unfilteredInstanceMBUsed
        FROM [dbo].[octpdba-931-detail] [d]
    GROUP BY d.[server Name]
)
,cteCurrentSize as (
    select g.[Server Name], sum(g.[SpaceUsedMB]) currentMbUsed
    from dbo.[octpdba-931-global] g
    GROUP BY g.[Server Name]
)

SELECT f.[Server Name], f.[filteredInstanceMBUsed], uf.[unfilteredInstanceMBUsed], c.[currentMbUsed]
    FROM [cteFilteredSize] f
    INNER JOIN [cteUnfilteredSize] uf on uf.[Server Name] = f.[Server Name]
    INNER JOIN [cteCurrentSize] c on [c].[Server Name] = f.[Server Name]
ORDER BY f.[Server Name]