Mark Needham
select competitorId, max(distance) AS distanceCovered
from parkrun
group by competitorId
order by distanceCovered DESC
And I want to only return records where distanceCovered is greater than say 1,000. But it doesn't like that.
What's the proper way to solve this type of problem?Anish Nair
01/25/2022, 4:01 PMMark Needham
Mark Needham
Anish Nair
01/25/2022, 4:03 PMMark Needham
Mark Needham
select competitorId, max(rawTime) AS rawTime, round(4726.577 - max(distance), 1) AS distanceToGo, max(distance) AS distanceCovered,
ToDateTime(1000 / (max(distance) / max(rawTime)) * 1000, 'mm:ss') AS pacePerKm,
ToDateTime(max(rawTime) * 1000, 'mm:ss') AS raceTime
from parkrun
group by competitorId
ORDER BY distanceToGo, rawTime
limit 10
I have lat and lon columns. How would I return the corresponding lat/long values for the max rawTime/distance rows?Rong R
01/25/2022, 5:05 PM