Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
How can I cancatenate multiple strings, I tried concat but did not work.
example:
CONCAT_WS( ' ',if(RNAS.R_TRAIN_NAME is null or "","",RNAS.R_TRAIN_NAME)," ", if(RNAS.I_POLICY_TYPE is null or "","",RNAS.I_POLICY_TYPE)," ",
if(RNAS.C_VEHICAL_TYPE is null or "","",RNAS.C_VEHICAL_TYPE),"",if(RNAS.V_DESTINATION_COUNTRY is null or "","",RNAS.V_DESTINATION_COUNTRY)," ",
if(RNAS.B_R_ORIGIN is null or "","",RNAS.B_R_ORIGIN),"-", if(RNAS.B_R_DESTINATION is null or "","",RNAS.B_R_DESTINATION)," ",
if(RNAS.I_DESTINATION is null or "","",RNAS.I_DESTINATION)," ", if(RNAS.M_REQUEST_DETAIL is null or "","",RNAS.M_REQUEST_DETAIL),"",
if(RNAS.C_SERVICE_TYPE is null or "","",RNAS.C_SERVICE_TYPE),"",if(RNAS.TICKET_NO is null or "","",RNAS.TICKET_NO)
) AS 'PARTICULARS'
Pls suggest.
Hi,
Try like this:
LOAD ...
if(len(R_TRAIN_NAME)>0, R_TRAIN_NAME & ' ' ) &
if(len(I_POLICY_TYPE )>0, I_POLICY_TYPE & ' ' ) &
...
if(len(RNAS)>0, RNAS) as PARTICULARS
FROM ...;
Please close this thread by selecting correct/helpful answer if it was useful for you. Otherwise, let me now and we will keep on solving your issue.
Thanks.