Search
 
SCRIPT & CODE EXAMPLE
 

SQL

how to get nears location in mysql with latitude and longitude

SELECT latitude, longitude, address_1, SQRT(
    POW(69.1 * (latitude - [starlat]), 2) +
    POW(69.1 * ([startlng] - longitude) * COS(latitude / 57.3), 2)) AS distance
FROM address HAVING distance < 25 ORDER BY distance

-- where [starlat] and [startlng] is the position where to start measuring the distance.
Comment

PREVIOUS NEXT
Code Example
Sql :: change role postgres 
Sql :: sql date get month 
Sql :: regex mongoose 
Sql :: postgresql create user 
Sql :: CONCAT_WS() concat function we can use for adds two or more expressions together with a separator or delimeter. 
Sql :: pl/sql loop example 
Sql :: csv to sqlite python 
Sql :: oracle show column of table 
Sql :: oracle sql merge 
Sql :: how to update random rows in sql 
Sql :: command line mysql xampp 
Sql :: sql drop default 
Sql :: show all tables postgres 
Sql :: database disk image is malformed sqlite fix ubuntu 
Sql :: mysql delete all except 
Sql :: like in mysql 
Sql :: postgres get defined index in table 
Sql :: how to create a table in mysql 
Sql :: inner join update 
Sql :: create a sqlite database c# 
Sql :: mysql store ip address 
Sql :: how to run mysql on terminal mac 
Sql :: xampp import sql file command line 
Sql :: oracle tablespace tables list 
Sql :: how to check grants on a package in oracle 
Sql :: use float in sql server string 
Sql :: how to find the number of rows updated in oracle pl/sql 
Sql :: delete database mysql command 
Sql :: change data type postgresql 
Sql :: sql create database 
ADD CONTENT
Topic
Content
Source link
Name
4+9 =