select t1.val2, t2.tmp2 from t1 join t2 on val1=tmp1