summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/sql.txt5
1 files changed, 5 insertions, 0 deletions
diff --git a/doc/sql.txt b/doc/sql.txt
new file mode 100644
index 0000000..cc9f187
--- /dev/null
+++ b/doc/sql.txt
@@ -0,0 +1,5 @@
+Useful queries:
+
+SELECT * FROM `rankings` JOIN drivers ON rankings._driver = drivers.id WHERE ranking >= (SELECT MAX(r.ranking) FROM rankings r WHERE r.rank_date <= rankings.rank_date) ORDER BY rank_date ASC
+
+ - selects top rating progression