SELECT* FROM TABLA1 T1 ,TABLA2 T2 WHERE T2.campo1= 1 AND to_char(T2.campo2) = to_char(T1.campoX) || to_char(T1.CampoY);