-
-
Save JavierGRP/bbdb91a101b0751e0bb01acbe70f44cb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE MATERIALIZED VIEW times_in_position_one AS | |
SELECT | |
CONCAT(d.forename, ' ', d.surname) AS driver, | |
SUM(f1.pos) AS num_of_pos_1_laps | |
FROM f1_lap_times f1 | |
INNER JOIN drivers d ON f1.driver_id = d.driver_id | |
INNER JOIN races r ON f1.race_id = r.race_id | |
WHERE f1.pos = 1 | |
GROUP BY CONCAT(d.forename, ' ', d.surname) | |
ORDER BY SUM(f1.pos) DESC | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment