Skip to content

Instantly share code, notes, and snippets.

Aroh Sunday melitus

Block or report user

Report or block melitus

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@melitus
melitus / SqlQueryStatement.txt
Last active Apr 9, 2018
I am working on a react redux app with express framework .The app will show users 20 items according to their point of interest within 25 miles to their current location
View SqlQueryStatement.txt
This is the code i have written to obtain the current user geolocation with react redux. I have this sql query to show 20 items according to their point of interest within 25 miles to their current location
```
SELECT id, ( 3959 * acos( cos( radians(37) ) * cos( radians( lat ) )
* cos( radians( lng ) - radians(-122) ) + sin( radians(37) ) * sin(radians(lat)) ) )
AS distance
FROM shops
HAVING distance < 25
ORDER BY distance
LIMIT 0 , 20;
```
You can’t perform that action at this time.