Link to home
Start Free TrialLog in
Avatar of Culwatrnca11
Culwatrnca11Flag for United States of America

asked on

Teradata SQL - Is it possible to take each line item and turn into column headers.

I have this code which displays each DX number in one column.  I would like these to show in 5 different columns as the headers, is that possible?

,case
      when dx.line = 1 then 'DX_1'      
      when dx.line = 2 then 'DX_2'      
            when dx.line = 3 then 'DX_3'      
            when dx.line = 4 then 'DX_4'      
            when dx.line = 5 then 'DX_5'      
            else 'N/A'      
end as "DX_Line"
ASKER CERTIFIED SOLUTION
Avatar of PortletPaul
PortletPaul
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Culwatrnca11

ASKER

Thanks PortletPaul, this was very helpful.  I was able to obtain a report utilizing this format and the usage of max(case when...  to create a sub subquery in my existing report.