Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 13 Dec 2006 @ 10:11:24 GMT


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


Subj:   Re: Assigning a default value to derived values in
 
From:   Kunnath, Sidharth

How about using your original query like a derived table?......

     Select
         Coalesce(Year,3000),
         Coalesce(Month,3000),
         TTL_TRANS_CNT,
         TTL_TRANS_AMT
     from
        (select
             extract(year from post_date)  "Year",
             extract(month from post_date) "Month",
             sum(case when detail_type = 41 then 1 else 0 end) as
         "TTL_TRANS_CNT",
             sum(case when detail_type = 60 then amount else 0 end) as
          "TTL_TRANS_AMT"
          from CLARITY_TDL_AGE
          where extract(year from post_date) = 2004
          and   extract(month from post_date) in (10,11)
          group by cube (1,2)) a
          order by 1,2;


     
  <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