mirror of
https://gitlab.com/wheres-the-tp/ui-mobile.git
synced 2026-01-25 05:54:56 -06:00
16 lines
310 B
MySQL
16 lines
310 B
MySQL
|
|
SELECT
|
||
|
|
*,
|
||
|
|
ST_AsGeoJSON(loc) as location,
|
||
|
|
ST_Distance(
|
||
|
|
loc,
|
||
|
|
ST_GeogFromText('SRID=4326;POINT(-97.7286718 30.3033267)')
|
||
|
|
) / 1609 as distance
|
||
|
|
FROM food_items
|
||
|
|
WHERE
|
||
|
|
ST_DWithin(
|
||
|
|
loc,
|
||
|
|
ST_GeogFromText('SRID=4326;POINT(-97.7286718 30.3033267)'),
|
||
|
|
10 * 1609
|
||
|
|
)
|
||
|
|
ORDER BY distance ASC;
|