J'ai créé l'utilisateur stocké suivant l'exécution de l'opération.Comment puis-je appeler une procédure stockée ou une fonction stockée à partir de l'instruction de sélection sql
CREATE FUNCTION spherical_distance1(@a float, @b float, @c float , @Lat float, @Lng float)
RETURNS float
AS
BEGIN
RETURN (6371 * ACOS(COS(@a/@b) * COS(@Lat/@b) * COS(@Lng/@b - @c/@b) + SIN(@a/@b) * SIN(@Lat/@b)))
END
Le problème que je suis confronté est ici, quand je l'appelle la fonction emmagasinés spherical_distance1, il indique l'erreur comme « spherical_distance1 » est pas un nom de fonction intégrée reconnue.
SELECT *, spherical_distance1(12.9216667, 57.2958, 77.591667, Lat, Lng) AS distance
FROM business3
WHERE distance < 3
AND StreetName LIKE '%jayanagar %'
AND Keyword LIKE '%plumbing %'
ORDER BY spherical_distance1(12.9216667, 57.2958, 77.591667, Lat, Lng);