forked from Weitzman-MUSA-GeoCloud/assignment01
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquery13.sql
More file actions
24 lines (22 loc) · 664 Bytes
/
Copy pathquery13.sql
File metadata and controls
24 lines (22 loc) · 664 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/*
Which station is furthest from Meyerson Hall?
Your query should return only one line, and only give the station id
(station_id), station name (station_name), and distance (distance) from
Meyerson Hall, rounded to the nearest 50 meters.
*/
-- Enter your SQL query here
select
id as station_id,
name as station_name,
(round(
st_distance(
geog,
st_setsrid(st_makepoint(-75.192584, 39.952415), 4326)::geography
) / 50.0
) * 50)::int as distance
from indego.station_statuses
order by st_distance(
geog,
st_setsrid(st_makepoint(-75.192584, 39.952415), 4326)::geography
) desc
limit 1;