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

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
44,003 questions
{count} votes

Your answer

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