Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 15 Aug 2006 @ 15:32:42 GMT


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


Subj:   Max And Count without Group by
 
From:   Castelli Emanuel Alejandro

Hi, I need to extract the max date by product and the total of each product, in a Single Query.

The table looks like:

     Col A   Col B
     P1      1/8/06
     P1      1/3/06
     P1      1/2/06
     P2      5/8/06

The result I want would looks like:

     Product         Max Date        Total
     P1              1/8/06          3
     P2              5/8/06          1

I calculate de max date using a qualify row_number, but I can't calculate the Total in the same query...

Can anybody help me?

Thanks and sorry for my English.


Bye!

Castelli, Emanuel Alejandro
Desarrollo DataWarehouse - IBM Argentina



     
  <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