Problem: concatenate multi rows in one row and column

Database

Problem: concatenate multi rows in one row and column

Goodmornig everybody, have a problem:

I have these two table :

TABLE_FACT
SCHD_CD ITEM_CD PRICE
100 0000001 100
101 0000002 100
102 0000003 100

TABLE_GEO_FACT
SCHD_CD GEO_CD
100 01
100 02
101 01
101 02
100 03
102 03

The relationship between tables is:
TABLE_FACT one row -> some rows TABLE_GEO_FACT
the join key is SCHD_CD.

The final result must be returned is :

SCHD_CD ITEM_CD PRICE GEO
100 0000001 100 01 | 02 |
101 0000001 100 01 | 02 | 03 |
101 0000001 100 03 |

How i can do this in view?
Thanks for your help.

Marco
2 REPLIES
Senior Apprentice

Re: Problem: concatenate multi rows in one row and column

Hi Marco,
http://www.teradataforum.com/teradata/20060710_173415.htm

But the fastest (and easiest) solution is an Aggregate UDF.

Dieter

Re: Problem: concatenate multi rows in one row and column