Created
May 10, 2012 03:03
-
-
Save dpassage/2650760 to your computer and use it in GitHub Desktop.
Sample Bayou Grand Prix SQL
This file contains hidden or 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
| select d.name, t.color, SUM(sg.points), t.name | |
| from raceresults rr, races r, scoring sg, drivers d, | |
| teams t, seasondrivers sd, schedule k where | |
| k.season = $season and | |
| k.race = r.id and | |
| rr.race = r.id and | |
| rr.driver = d.id and | |
| rr.place = sg.place and | |
| rr.dnf = FALSE and | |
| sd.driver = d.id and | |
| sd.defaultteam = t.id and | |
| sd.season = k.season and | |
| sg.scheme = $schemeid | |
| group by d.name, t.color, t.name | |
| order by 3 desc, 1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment