· 9 years ago · Oct 19, 2016, 03:16 PM
1USE crappatrol2;
2
3
4DROP TABLE IF EXISTS AquilaReplays;
5CREATE TEMPORARY TABLE AquilaReplays (ID BIGINT PRIMARY KEY NOT NULL, Duration TIME NOT NULL, NewDuration TIME NOT NULL);
6INSERT INTO AquilaReplays SELECT ID, Duration, ADDTIME(Duration, '0:30:0') FROM crappatrol2.ReplayContext WHERE Player1Hero=7 OR Player2Hero=7 OR Player3Hero=7 OR Player4Hero=7;
7
8SELECT * FROM AquilaReplays;
9
10DROP TABLE IF EXISTS TmpReplay;
11CREATE TEMPORARY TABLE TmpReplay LIKE Replay;
12INSERT INTO TmpReplay SELECT * FROM Replay;
13
14SELECT * FROM TmpReplay WHERE ID >= 1665;
15
16UPDATE TmpReplay as orig,AquilaReplays as tmp SET orig.Duration=tmp.NewDuration WHERE orig.ID = tmp.ID;
17
18SELECT * FROM TmpReplay WHERE ID >= 1665;