Oracle
 sql >> Base de Dados >  >> RDS >> Oracle

Sql combinando duas colunas em uma variável


Usar || para concatenar no oracle
SELECT A.*,
       K1.AD || K1.SYD as CONTACT,
       KR.AD KURUM,
       K2.AD SUPERVISORAD,
       K2.SYD  SUPERVISORSOYAD,
       K3.AD REQUIRERAD,
       K3.SYD REQUIRERSOYAD
FROM  
       TD_ACTIVITY A,
       KK_KS K1,
       KK_KS K2,
       KK_KS K3,
       KK_KR KR
WHERE  A.INS_CONTACT_PERSON = K1.ID
   AND A.SUPERVISOR =  K2.ID
   AND A.REQUIRERID = K3.ID 
   AND A.INSTITUTIONID = KR.ID