Simplify SQL queries
Simplify SQL queries

Instead of having several different queries, build a query statement depending
on the filter and selected trip. Also reduce code duplication when getting the
average speed and number of entries.

espinosaluis/TrackMeViewer,espinosaluis/TrackMeViewer