WITH t1 AS (SELECT a1, a2 FROM A), t2 AS (SLECT b1, b2 FROM B) SELECT t1.a1, t2.b2 FROM t1, t2 WHERE t1.a2 = t2.b1
WITH t1 AS (SELECT a1, a2 FROM A), t2 AS (SLECT b1, b2 FROM B)
SELECT t1.a1, t2.b2 FROM t1, t2 WHERE t1.a2 = t2.b1