diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2017-02-27 15:21:12 +0100 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2017-02-27 15:21:12 +0100 |
| commit | bcdb29305a18e4e2add7ce9c28fe481768bb5201 (patch) | |
| tree | 6e6cfbabae831fde9ea53ba869bb4222e309d1fb /queries/roster.sql | |
| parent | 2a0d6028757600f9761d81bdd647b3b59cb47495 (diff) | |
| download | processor-bcdb29305a18e4e2add7ce9c28fe481768bb5201.tar.gz processor-bcdb29305a18e4e2add7ce9c28fe481768bb5201.zip | |
process roster's match_apiId
Diffstat (limited to 'queries/roster.sql')
| -rw-r--r-- | queries/roster.sql | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/queries/roster.sql b/queries/roster.sql index c61967b..2344c7f 100644 --- a/queries/roster.sql +++ b/queries/roster.sql @@ -1,8 +1,10 @@ WITH rosters AS (SELECT + id AS matchid, JSONB_ARRAY_ELEMENTS(match.data->'relations') AS roster FROM match WHERE id=$1) SELECT -roster->'data'->>'id' as "apiId", +roster->'data'->>'id' AS "apiId", +matchid AS "match_apiId", (roster->'data'->'attributes'->'stats'->>'acesEarned')::int AS "acesEarned", (roster->'data'->'attributes'->'stats'->>'gold')::int AS "gold", (roster->'data'->'attributes'->'stats'->>'heroKills')::int AS "heroKills", |
