-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathquery.py
More file actions
40 lines (32 loc) · 916 Bytes
/
Copy pathquery.py
File metadata and controls
40 lines (32 loc) · 916 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import urllib3
import certifi
import json
import sqlite3
import traceback
import math
from collections import defaultdict
# Init
conn = sqlite3.connect('database.db')
c = conn.cursor()
try:
# c.execute('''SELECT totalFlatItemAp, totalPercentItemAp, totalFlatRuneAp, totalPercentRuneAp
# FROM participant
# LEFT JOIN match ON participant.matchId = match.id
# WHERE match.id = 1852538938 and participant.id = 2''')
# print(json.dumps(c.fetchall(), indent=2))
c.execute('''SELECT participantItem.itemId, item.id, item.name, match.version
FROM participantItem
LEFT JOIN match ON participantItem.matchId = match.id
LEFT JOIN item ON participantItem.itemId = item.id AND match.version = item.version
WHERE matchId = 1852538938 AND participantId = 2;
''')
print(json.dumps(c.fetchall(), indent=2))
conn.commit()
except:
traceback.print_exc()
conn.close()
print('Done!')
input()
1852538938
2
74