Teradata conversion to SSMS

Sherlan Emmanuel Burgonia 86 Reputation points
2022-12-07T00:55:19.667+00:00

Hi,

I'm trying to convert this code from teradata to SQL SSMS

Trim(Trailing ',' FROM (XmlAgg(Trim(CONCAT(CPN.Origin,'-',CPN.Destination))|| ' ' || ',' ORDER BY CPN.CouponNumber) (VARCHAR(250)))) AS "Route",  

I tried working on this but there's no luck
TRIM(',', FROM CONCAT(CPN.Origin + '-' + CPN.Destination + '' + ',' ORDER BY CPN.CouponNumber) AS "TestRoute"

Basically the goal of this query is to identify all the possible routes from a single Primary key

267975-image.png

Community Center | Not monitored
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.