Can any one help me in solving this. In a table for the columns Division and Node , I have the data like this right now
this question has been asked numerous times :-)
What's your Teradata release?
Since TD14 there's STRTOK_SPLIT_TO_TABLE:
FROM TABLE (STRTOK_SPLIT_TO_TABLE(your_table.Division, your_table.Node, '-')
RETURNS (outkey VARCHAR(10) CHARACTER SET UNICODE
,token VARCHAR(30) CHARACTER SET UNICODE)
) AS dt
The size of both outkey and token should be changed to match the actual length.
How to do the exact reverse of this? As in to to get key and concat rows into single columns.
SELECT * FROM dbc.FunctionsV
WHERE FunctionName = 'XMLAGG';
TRIM(TRAILING ',' FROM (XMLAGG(Column_B || ','
ORDER BY ColumnB
GROUP BY 1