Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 06 Feb 2008 @ 20:06:16 GMT


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


Subj:   How to code a join or restructure table?
 
From:   Pinti, Michele A

I have a table of data formatted as

     ID   Name     Amount   Rate
     65   SCHDLA   0.1399   0.0430
     66   SCHDLA   0.1499   0.0470
     67   SCHDLA   0.1599   0.0500
     68   SCHDLA   0.1699   0.1000

I have the amount field but need to return the rate.

If the amount = .1653 we need to return row 67 because it is greater or equal to .1599 and less than .1699.

Is there a way to accomplish this with the current structure or should I change the table to have Low and High Amount?

                    Low      High
     ID   Name     Amount   Amount   Rate
     65   SCHDLA   0.1399   0.1499   0.0430
     66   SCHDLA   0.1499   0.1599   0.0470
     67   SCHDLA   0.1599   0.1699   0.0500
     68   SCHDLA   0.1699   0.1799   0.1000


     
  <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: 27 Dec 2016