Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 22 Aug 2008 @ 13:27:13 GMT


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


Subj:   Re: How Can I Avoid Repeating an Expression?
 
From:   Ohlman, Jeffery

Create an alias as in this example. You have to change your group by as well

     sel  foo,
          100 * (curr_bal - cl_amt) / cl_amt as my_calc,
          case when my_calc <= 10
               then '(2)  <= 10%'
               else '(6)  > 25%' end     OL_Pct,
           count(1) Number
     from  Table
     Group by foo, cur_bal, cl_amt


     
  <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