Joining two tables based on two Aggregate columns
Something like this:
with 
ta as (select a.customerid, sum(a.items) amount_a
       from orders a
       group by a.customerid
      ),
tb as (select sum(b.items) amount_b
       from tableb b
      )
select ta.customerid, ta.amount_a, tb.amount_b
from ta join tb on ta.amount_a = tb.amount_b