It does sum(value) where value is defined as:
if A.TableA = 20 then value=B.TableB
else value=0