diff options
author | emkael <emkael@tlen.pl> | 2017-04-06 01:53:44 +0200 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2017-04-06 01:53:44 +0200 |
commit | e561163f93c9f7a3d2aea49543b5b9599e54ea51 (patch) | |
tree | a78c5c6834c6e90d43665480df21ff338276d4ba /docs/useful-sql.md | |
parent | e106531c0d74dccb20794ab9226bbde52fc4129e (diff) |
Documentation tips + example config for players histories
Diffstat (limited to 'docs/useful-sql.md')
-rw-r--r-- | docs/useful-sql.md | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/docs/useful-sql.md b/docs/useful-sql.md new file mode 100644 index 0000000..32a8f5b --- /dev/null +++ b/docs/useful-sql.md @@ -0,0 +1,21 @@ +Update categories from current `players` table: + +``` +UPDATE rankings +JOIN players + ON players.id = rankings.pid +SET rankings.region = players.region, + rankings.flags = players.flags +WHERE rankings.date = '#DATE#'; +``` + +After importing ranking CSV to `temp_rankings`, copy to `rankings` with current categories: + +``` +INSERT INTO rankings ( + SELECT pid, `date`, place, score, region, flags \ + FROM temp_rankings + JOIN players + ON players.id = temp_rankings.pid +); +``` |