Archived
1
0
Fork 0
This repository has been archived on 2024-06-28. You can view files and clone it, but cannot push or open issues or pull requests.
citybike/abfragen.sql

34 lines
671 B
MySQL
Raw Normal View History

2016-05-31 16:13:17 +02:00
#Näherste / fernste Stationen
SELECT id,length,s.name,g.name FROM connections
LEFT JOIN stationen as s ON start=s.ref
LEFT JOIN stationen as g ON goal=g.ref
ORDER BY length ASC
# Suche nach Namen
SELECT *
FROM stationen WHERE name LIKE "%Spitt%";
#gpsprune
SELECT
name,
length,
group_concat(id,".gpx" SEPARATOR " ")
FROM connections
LEFT JOIN stationen ON (start = ref OR goal = ref)
WHERE ref = 906
ORDER BY length
#(vermutlich) abgelegenste Stationen
SELECT *
FROM (SELECT
name,
length,ref
FROM connections
LEFT JOIN stationen ON (start = ref OR goal = ref)
ORDER BY length ASC ) as x
GROUP BY ref
ORDER BY length ASC