JOIN
SQL-L042JOIN
clauses should not contain subqueries.
Use Common Table Expression(CTE, aka WITH statement)s instead.
Some dialects don't allow CTEs, for those dialects this rule should be disabled.
SELECT
a.x, a.y, b.z
FROM a
JOIN (
SELECT x, z from b
) USING(x)
WITH c as (
SELECT x, z from b
)
SELECT
a.x, a.y, c.z
FROM a
JOIN c USING(x)