Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 06 Feb 2008 @ 23:37:48 GMT


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


Subj:   Re: How to code a join or restructure table?
 
From:   Michael Larkins

This is how I would do it:

     select rateid,
            name,
            rate
       from rates
     qualify .1653 between amount and
              max(amount) over(partition by name
                               order by amount
                               rows between 0 preceding
                                        and 1 following)

Regards,

Michael Larkins
Certified Teradata Master
Certified Teradata SQL Instructor



     
  <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