help me about grouping function

UDA
Enthusiast

help me about grouping function

hi ,

this is my data

cust_id product_name
001 prod_A
001 prod_B
002 prod_A
003 prod_B
003 prod_C

and I want to generate output like this

001 Prod_A , Prod_B
002 Prod_A
003 Prod_B , Prod_C

How do I write query?

Thanks you very much.
4 REPLIES
Enthusiast

Re: help me about grouping function

Hi,
Through SQL i do not think it is possible.
In reporting tools, it may be possible as u r converting rows into columns.

Regds,
sachin
Enthusiast

Re: help me about grouping function

Thanks sachin,

In this case
if my database is oracle I can use PL/SQL open cursor to solve it but on teradata....how do I?
Junior Contributor

Re: help me about grouping function

Hi PajinkO,

http://www.teradata.com/teradataForum/shwmessage.aspx?forumid=10&messageid=1285

Dieter
Enthusiast

Re: help me about grouping function

Thank you very much Dieter,

I can convert my data from rows to column.