Summing "Other" remaining after Top 5 I have the query below which returns the top 5 sum per brokerage

SELECT * 
FROM  (SELECT b.brokerage_name AS Brokerage, 
              SUM(c.cost)      AS Cost 
       FROM   (tblquotesnew q 
               left join tblbrokeragesnew b 
                      ON q.brokerage_id = b.id) 
              left join tblcommissionnew c 
                     ON q.quoteid = c.quote_id 
       WHERE  c.calc_date &gt;= Trunc(SYSDATE, 'iw') 
              AND c.calc_date &lt;= Trunc(SYSDATE, 'iw') + 7 - 1 / 86400 
       GROUP  BY b.brokerage_name 
       HAVING SUM(c.cost) IS NOT NULL 
       ORDER  BY SUM(c.cost) DESC) 
WHERE  ROWNUM &lt;= 5 
ORDER  BY ROWNUM; 


Is it possible, in the same query, to have a sixth row returned for Other, which would be a sum of the remaining c.cost?
You can use a CTE (WITH clause), that precomputes all the SUM(Costs) and then UNION ALL two queries: one with the "top 5" from the CTE; the other one with the SUM of the rest:

WITH q2 AS
(
SELECT
    q1.*, row_number() over (order by Cost DESC) AS r
FROM
    (
    SELECT 
        q.brokerage_id, SUM(c.cost) AS Cost
    FROM   
        tblquotesnew q 
        join tblcommissionnew c  ON q.quoteid = c.quote_id 
    WHERE  
        c.calc_date &gt;= Trunc(SYSDATE, 'iw')  AND c.calc_date &lt;= Trunc(SYSDATE, 'iw') + 7 - 1 / 86400 
    GROUP BY 
        q.brokerage_id 
    HAVING 
        SUM(c.cost) IS NOT NULL
    ) q1
ORDER BY 
    Cost DESC
)
-- The "top 5"
SELECT 
    q2.r AS rank, b.brokerage_name AS Brokerage, q2.Cost
FROM 
    q2 LEFT JOIN tblbrokeragesnew b ON b.id = q2.brokerage_id
WHERE
    r &lt;= 5
UNION ALL
-- The sum() of the rest (notice there is no group by; we add them all)
SELECT
    6 AS rank, 'Others', SUM(Cost)
FROM
    q2
WHERE
    r &gt; 5 
ORDER BY
    rank ;


You'll get a result that looks like:


RANK | BROKERAGE   | COST
---: | :---------- | ---:
   1 | Brokerage 1 | 8351
   2 | Brokerage 5 | 2231
   3 | Brokerage 4 | 2227
   4 | Brokerage 3 | 2223
   5 | Brokerage 7 | 2210
   6 | Others      | 4420




NOTES:


Your LEFT JOIN on tblcommissionnew is actually an INNER JOIN, since you use tblcommissionnew in your where in such a way that it will eliminate all nulls.
You don't need to JOIN with the tblbrokeragesnew table until the end. Oracle probably is good enough to optimize it, but it's cleaner to do it explicitly. (I've assumed that tblbrokeragesnew.id is a PK).


You can check everything (including the table definitions I've assumed) at dbfiddle here