select a.k3, b.d9 from tper18 a, tper18 b where a.k3 = b.d9 and a.k9 = 'xyzxyz' ; select a.k9, b.d3 from tper18 a, tper18 b where a.k9 = b.d3 ; select a.k9, b.d3 from tper18 a, tper18 b WHERE CAST(A.K9 AS CHAR(3))=B.D3