I have a table with multiple entries by user.
runtime | distance | username
0:16:01 | 3.1 | avgjoe
0:16:30 | 3.1 | avgjoe
0:33:43 | 6.2 | avgjoe
0:35:10 | 6.2 | avgjoe
0:24:00 | 3.1 | bertha
0:24:54 | 3.1 | bertha
I am trying to figure out the syntax to create a view based on min(time_to_sec for each distance.
So based on the sample data, my view would consist of:
0:16:01 | 3.1 | avgjoe
0:33:43 | 6.2 | avgjoe
0:24:00 | 3.1 | bertha
Since these records are the min seconds for each distance value.
Where to start!!!???
Trying this and something just ain't right...appreciate any direction (if this is even possible!)
SELECT runid, rundate, runtime, distance, username, workout_type, min(time_to_sec(runtime)) as 'totalsecs' from log3 where workout_type = 'Race' group by username
I get 1 row returned...hmmm.