Em Andamento

Help Completing GPS MySQL StoreProcedure Select Statement(repost)

I need a MYSQL stored Procedure to take in 3 params:

CREATE PROCEDURE `distance`(IN mymsgid int,IN user_id int, IN mydistance float)

BEGIN

declare mylon double;

declare mylat double;

SELECT latitude, longitude into mylat, mylon from USER WHERE id = user_id;

SELECT id, ( 6371 * acos( cos( radians(mylat) ) * cos( radians( latitude ) ) * cos( radians( longitude ) - radians(mylon) ) + sin( radians(mylat) ) * sin( radians( latitude ) ) ) ) AS distance

FROM USER HAVING distance < mydistance ORDER BY distance LIMIT 0 , 20;

END

The code above returns ID and distance, but I need data from two tables joined by userid and msgid > mymsgid

I have two tables I need joined that has a distance of myDistance. I will forward all the schemas once bidder is selected.

Additional, if you have any GPS coordinate mysql experenice for faster queryies, if this is the best way to go. I do not plan on doing full table scans.

I will send over the schemas

Habilidades: Administração de Bancos de Dados, Linux, Instalação de Script, Shell Script, Arquitetura de software, UNIX

Ver mais: need linux help, sin, sin cos, select, need gps, cos, mysql select statement, linux mysql create, mysql create table data, mysql help table, schemas, gps send, msgid, send gps data mysql, 2010 procedure, mysql distance, distance table, mysql statement, send gps data table, code gps distance, distance gps data, linux gps mysql, procedure mysql, mysql end user, mysql procedure

Acerca do Empregador:
( 33 comentários ) United States

ID do Projeto: #2976044

Premiar a:

simplycreativevw

See private message.

$25.5 USD em 2 dias
(8 Avaliações)
3.0

3 freelancers estão ofertando em média $31 para este trabalho

naeemakhtarvw

See private message.

$59.5 USD in 2 dias
(6 Comentários)
2.5
itozovw

See private message.

$8.5 USD in 2 dias
(1 Comentário)
1.3