Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 28 Apr 2006 @ 11:42:30 GMT


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


Subj:   Re: Need Help Writing SQL
 
From:   Cappelli, Andrea

I don't know if I really understand your needs... But try this...

     select a.col1,a.col2,a.col3,case when (dist_val)=1 then col3 else 8 end
     from tabA a
     inner join
     (select col1,count(distinct col3) as dist_val
     from tabA
     group by 1) b
     on a.col1=b.col1

Andrea Cappelli
NCR Italia
Teradata Professional Services
Teradata Certified Implementation Specialist V2R5



     
  <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