select top 3 id=identity(int),aaa into #t1 from t1 select top 3 id=identity(int),aaa into #t2 from t2select a.aaa,b.aaa from #t1 a,#t2 b where a.id=b.id drop table #t1,#t2
select top 3 t1.aaa,t2.bbb from t1 left join t2 on right(t1.aaa,1) = right(t2.bbb,1)
select top 3 id=identity(int),aaa into #t2 from t2select a.aaa,b.aaa from #t1 a,#t2 b where a.id=b.id
drop table #t1,#t2