If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > query for calculating 1/2 distance btwn 2 points (not spatial)

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-12-11, 01:13
valdense valdense is offline
Registered User
 
Join Date: Aug 2008
Posts: 4
query for calculating 1/2 distance btwn 2 points (not spatial)

Hello,
I am trying to write a query which will give me a buffer 1/2 the size of the actual distance between two points.
This is not a spatial query as the distance is already in one of the tables as an attribute.
Below is the query I've written so far but it doesnt work yet:

select m.rwo_key_id,min(buffer_size)buffer_size
from (select m.rwo_key_id,
case
when min(p.route_length)/2<100 then urban
else min(p.route_length)/2 rural
end buffer_size
from hv_span@na_to_sorepview p, mz_cl_poles m
where p.construction_status = 'as constructed'
and (p.pole_1 = m.rwo_key_id or p.pole_2 = m.rwo_key_id))
group by p.rwo_key_id;

I've also included screen dumps of the tables i'm querying.
Can someone help??

thank you!
Attached Thumbnails
query for calculating 1/2 distance btwn 2 points (not spatial)-mz_cl_poles.jpg   query for calculating 1/2 distance btwn 2 points (not spatial)-hv_span.jpg  
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On