Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 08 May 2006 @ 20:04:08 GMT


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


Subj:   Re: Distance calcuations
 
From:   Anomy Anom

<-- Anonymously Posted: Monday, May 08, 2006 13:01 -->

Here's another way that may work for you.

Add 'n' new attributes to the LOCATION and STATION tables like this:

     Distance_Mile_Range_1
     Distance_Mile_Range_2
     Distance_Mile_Range_3

Now, for each LOCATION & STATION row, fill in the Distance_Mile_Range_n column to a fixed point in the globe, say Dallas, TX or some other point like 45.0000 Latitude, 90.0000 Longitude.

Write the JOIN between LOCATION and STATION using one of the new columns.

Simply use the Distance_Mile_Range_n column for pre-determined precisions of say 10 miles, 30 miles, and 100 miles in this example.

     Select A,B,C,
        from LOCATION L,
               STATION    S
     Where L.Distance_Miles_Amt_1 = S.Miles_Amt_1;

This shall give you a quick result set for different precisions without math in the WHERE clause.

Note that the 10 mile range would be 20 miles since it would bring together two rows that could be at the exact opposite ends.

The smaller the precision the better the results.


Anonym



     
  <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