select 
    aa,
    bb
from 
    (select a.a aa,b.a ba,b.b bb from a,b where a.a=b.a(+))