1
0
mirror of https://github.com/Microsoft/sql-server-samples.git synced 2025-12-08 14:58:54 +00:00
Files
sql-server-samples/samples/features/json/geo-json/dotnet-states-openlayers2/sql-scripts/GetCities.sql
2016-12-03 10:29:47 +01:00

15 lines
724 B
SQL

select
'FeatureCollection' as [type],
(
select
'Feature' as [type],
[Location].AsGeoJSON() as [geometry],
[CityName] as [properties.name],
ac.LatestRecordedPopulation as [properties.population]
from Application.Cities ac, Application.StateProvinces asp
where asp.StateProvinceCode = 'FL'
and ac.StateProvinceID = asp.StateProvinceID
and ac.LatestRecordedPopulation >= 20000
for json path
) as [features]
for json path, without_array_wrapper