﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Teradata Forums / Teradata  / Teradata Database  / VERTICAL STRING CONCATENATION / Latest Posts</title><generator>InstantForum.NET v4.1.4</generator><description>Teradata Forums</description><link>http://www.teradata.com/teradataforum/</link><webMaster>info@teradata.com</webMaster><lastBuildDate>Wed, 03 Dec 2008 16:18:09 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: VERTICAL STRING CONCATENATION</title><link>http://www.teradata.com/teradataforum/Topic11847-9-1.aspx</link><description>Recursive SQL is your best option and you can search this forum for many examples.Also, you could use Informatica to handle it, or write a stored procedure with a cursor.  </description><pubDate>Fri, 11 Jul 2008 08:13:10 GMT</pubDate><dc:creator>jeff_o</dc:creator></item><item><title>RE: VERTICAL STRING CONCATENATION</title><link>http://www.teradata.com/teradataforum/Topic11847-9-1.aspx</link><description>Thanks. Is there a better one query solution you can think of?R</description><pubDate>Thu, 10 Jul 2008 11:12:57 GMT</pubDate><dc:creator>Ron Luebke</dc:creator></item><item><title>RE: VERTICAL STRING CONCATENATION</title><link>http://www.teradata.com/teradataforum/Topic11847-9-1.aspx</link><description>It kind of gets ugly, and is sort of a cross join in disguise ... I wouldn't sign my name on performance ;) ... but is there for academic purposes..WITH RECURSIVE MYREC(STE, CITY, LVL)AS(SELECT ST, MIN(CTY) (VARCHAR(1000)), 1FROM RTST001GROUP BY 1UNION ALLSELECT ST,  CTY || ',' || CITY, LVL+1FROM RTST001 INNER JOIN MYRECON ST = STEAND CTY &amp;gt;  CITY)SELECT STE, CITYFROM MYRECQUALIFY RANK() OVER(PARTITION BY STE ORDER BY LVL DESC) = 1;</description><pubDate>Fri, 13 Jun 2008 18:07:41 GMT</pubDate><dc:creator>joedsilva</dc:creator></item><item><title>VERTICAL STRING CONCATENATION</title><link>http://www.teradata.com/teradataforum/Topic11847-9-1.aspx</link><description>Has anyone used the WITH RECURSIVE to do concatenation of strings in Teradata. I have used this in other DBs, but every method I have tried is being blocked by one restriction or another (usually forbidding a derived table or restrictions on ROW_NUMBER()). UDFs are out as the security Nazis have forbidden them. I would REALLY prefer not to use a temp table or stored proc.For example, If I have a table,COL1   COL2----    -----MO    FLORISSANTMO    ST.LOUISMO    SPRINGFIELDAL     BIRMINGHAMAL     MONTGOMERYI want the result to beMO    FLORISSANT, ST.LOUIS, SPRINGFIELDAL     BIRMINGHAM, MONTGOMERY</description><pubDate>Fri, 13 Jun 2008 11:29:30 GMT</pubDate><dc:creator>Ron Luebke</dc:creator></item></channel></rss>