Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 19 Feb 2008 @ 23:23:07 GMT


     
  <Prev Next>   <<First <Prev
Next>
Last>>
 


Subj:   Re: Function for Pivoting Data
 
From:   Sapra, Kapil Dev

Hi,

I am not sure if below idea will help you.. Just come in mind so sharing with you..

Yes, In this you can add more SEQNO.. Thanks.

Just a logic..

     SEL
     E.EMPLOYEEID
     , E.EMPNAME
     , MAX(CASE WHEN D.SEQNO IS NULL THEN D.DATE1 ELSE NULL END)
     , MAX(CASE WHEN D.SEQNO = 1 THEN D.DATE1 ELSE NULL END)
     , MAX(CASE WHEN D.SEQNO = 2 THEN D.DATE1 ELSE NULL END)
     FROM EMPLOYEE E
     , EMPLOYEEDATE D
     WHERE E.EMPLOYEEID = D.EMPLOYEEID
     GROUP BY 1, 2, 3
     Order by 1, 2

Regards,

Kapil D Sapra



     
  <Prev Next>   <<First <Prev
Next>
Last>>
 
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023