0
votes

Select ContractVersionId ,Origin XMLAGG(FIRSTSTATION || '/' ORDER BY FIRSTSTATION) AS InterTransptAndCarrCode FROM LdCONTRACTMULTISEGMENT WHERE firstsegair1='AC' AND secondsegair1 <> 'AC' GROUP BY 1,2,SECONDSEGAIR1

1

1 Answers

1
votes

XMLAGG is a Teradata function, you can't expect all these functions to work in snowflake as-is. But you're simply trying to get a group concat and snowflake supports the Standard SQL function for it:

LISTAGG(FIRSTSTATION, '/') WITHIN GROUP (ORDER BY FIRSTSTATION)