summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2014-10-22 23:16:08 +0200
committeremkael <emkael@tlen.pl>2014-10-22 23:16:08 +0200
commite12a33eb9b31b65b12ed90f0c4ead337ea647c3c (patch)
tree5d2e26b377ed3944e03125a544e501bf3483dd40
parent7cd0222e730798399a30057dafdaf19cc193a9c3 (diff)
* useful SQL queries
-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