Find Jobs
Hire Freelancers

Mysql geo-lookup stored procedure needed

£10-20 GBP

Completed
Posted over 7 years ago

£10-20 GBP

Paid on delivery
This is all simplified, but should be enough to complete the task :- I have a primary table; `providers` id (bigint) name location (point) radiusKm (int) I use a stored procedure to retrieve any providers within catchment (simplified); SELECT id, name, location, degToMeter(st_distance(@checkPoint, location)) AS distance FROM providers WHERE degToMeter(st_distance(@checkPoint, location)) < radiusKm However, I have now needed to add an additional table to account for additional depots; `depots` id (bigInt) providerId (bigint) location (point) radiusKm (smallint) The procedure must now return all providers that have a depot within the vicinity of a given point. The resulting fields I will need are :- id - The provider ID name - The provider name depotId - ID of the provider's closest depot location - location of the provider's closest depot distance - The distance of the checkPoint to the selected depot So we need a grouping of the depots for each provider, ordered by distance, with only the closest one being returned. i.e. If two depots of a single provider are within catchment, the returned provider would only show the closest one, and not return the same provider twice. I expect this project to take a suitable candidate and hour at most to complete. I'm looking for something efficient and elegant. Many thanks.
Project ID: 11354709

About the project

4 proposals
Remote project
Active 8 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
Hello, I am interested in your project. I am a software engineer and I have professional experience with MySQL. Thank you, Best regards, David
£50 GBP in 0 day
5.0 (15 reviews)
3.2
3.2
4 freelancers are bidding on average £25 GBP for this job
User Avatar
Hello. Would you need this as a separate procedure to return only depots and their providers? Do you have the depots table ready? Would you give me the access to the real database? I'm ready to start. Thanks. Eugene
£22 GBP in 0 day
5.0 (86 reviews)
5.7
5.7
User Avatar
Hi there, I am a professional Graphic Designer & wordpress expert with 2+ years experience. I am also a Student of Software Engineering in Pakistan. I have read and understand your project Description. I can make complex SQL complex Queries to insert, fetch, delete and update data from your database. previous work : Found errors in query select *, count(distinct vi.views_id) as ViewCount from campaigns cam left join views vi ON vi.views_campaign_id = cam.campaigns_id left join rates ra on ra.rates_id = cam.campaigns_rates_id where cam.campaigns_budget_used_today < cam.campaigns_daily_budget and cam.campaigns_current_budget > 0 and cam.campaigns_approved = 1 and cam.campaigns_status = 0 and cam.campaigns_payment_accepted = 1 and cam.campaigns_device = 1 or cam.campaigns_device = 0 and ra.rates_location IS NULL group by cam.campaigns_daily_budget having ViewCount <= cam.campaigns_ordered_views * 1000 order by cam.campaigns_daily_budget asc Please inbox me if you are willing to work with me. Waiting for your response. Thanks Kind Regards Rehan828
£10 GBP in 1 day
0.0 (0 reviews)
0.0
0.0

About the client

Flag of UNITED KINGDOM
London, United Kingdom
5.0
2
Payment method verified
Member since Aug 10, 2016

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.