Archives of the TeradataForum
Message Posted: Wed, 06 Feb 2008 @ 20:06:16 GMT
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
|