Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 09 Oct 2012 @ 22:04:43 GMT


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


Subj:   Re: Need to transpose a column to Row
 
From:   Myrna, James

Not exactly what you are looking for, but close.

     SELECT UserName, DatabaseName, TableName,
            MAX(CASE AccessRight WHEN 'R'   THEN 'Y' ELSE ' ' END) AS "SELECT",
            MAX(CASE AccessRight WHEN 'I'   THEN 'Y' ELSE ' ' END) AS "INSERT",
            MAX(CASE AccessRight WHEN 'U'   THEN 'Y' ELSE ' ' END) AS "UPDATE",
            MAX(CASE AccessRight WHEN 'D'   THEN 'Y' ELSE ' ' END) AS "DELETE"

     FROM dbc.AllRights

     GROUP BY 1,2,3
     ORDER BY 1,2,3

Jim



     
  <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