Forum » Programiranje » mysql create function
mysql create function
Reso ::
Ali bi mi kdo znal pomagati pri tem sql queryju, ki mi nagaja. Problej je nekje pri deklaraciji input parametrov in sicer je syntak error. Hvala
CREATE FUNCTION haversine (l1 float, o1 float, l2 float, o2 float) RETURNS INT
DETERMINISTIC
BEGIN
l1 = RADIANS(l1);
l2 = RADIANS(l2);
o1 = RADIANS(o1);
o2 = RADIANS(o2);
DECLARE distance INT;
SET distance = (7926-26*SIN(l1))*ASIN(MIN(1,0.707106781186548*SQRT((1-(SIN(L2)*SIN(l1))-COS(l1)*COS(l2)*COS(o2-o1))))));
RETURN distance;
END
CREATE FUNCTION haversine (l1 float, o1 float, l2 float, o2 float) RETURNS INT
DETERMINISTIC
BEGIN
l1 = RADIANS(l1);
l2 = RADIANS(l2);
o1 = RADIANS(o1);
o2 = RADIANS(o2);
DECLARE distance INT;
SET distance = (7926-26*SIN(l1))*ASIN(MIN(1,0.707106781186548*SQRT((1-(SIN(L2)*SIN(l1))-COS(l1)*COS(l2)*COS(o2-o1))))));
RETURN distance;
END
Vredno ogleda ...
Tema | Ogledi | Zadnje sporočilo | |
---|---|---|---|
Tema | Ogledi | Zadnje sporočilo | |
» | [C#] Iskalno DrevoOddelek: Programiranje | 2066 (1632) | Ciklamen |
» | Arduino MySQLOddelek: Programiranje | 1019 (744) | abcd123 |
» | [PHP] Razdalja med dvema koordinatamaOddelek: Programiranje | 739 (701) | Roadkill |
» | EXCEL - ali se da nastaviti da racuna v stopinjah in ne v radijanihOddelek: Programska oprema | 2983 (2329) | superb_ |
» | [Java] Zagon appleta v HTMLOddelek: Programiranje | 1539 (1361) | Bela01 |