Rows to column in Teradata SQL asistant

Tools & Utilities
Fan

Rows to column in Teradata SQL asistant

Hi,
I have table which has
input
enc diag
1 66
1 22
1 33
2 11
2 44
2 55

i want the output as
enc diag diag diag
1 66 22 33
2 11 44 55
Can any one help
the above fields are varchar.

thansk in advance please
1 REPLY
Enthusiast

Re: Rows to column in Teradata SQL asistant

Hi Kunny,

Ya , We can do that ,

try to use CASE & COALESCE Function. This will help you...

Let me know If you are not clear , then I will explain you with the example...