2022-09-02 17:06:02 -04:00
|
|
|
library(RMySQL)
|
|
|
|
|
2022-09-03 18:54:56 -04:00
|
|
|
conn <- dbConnect(
|
2022-09-02 17:06:02 -04:00
|
|
|
MySQL(),
|
|
|
|
user = dbuser,
|
|
|
|
password = dbpass,
|
|
|
|
dbname = dbname,
|
|
|
|
host = dbhost,
|
|
|
|
port = dbport
|
|
|
|
)
|
2022-09-03 18:54:56 -04:00
|
|
|
|
|
|
|
consulta_frames <- "
|
|
|
|
SELECT
|
|
|
|
f.coins, CAST((f.elapsed_time / 1000) AS INT)
|
|
|
|
FROM game g
|
|
|
|
LEFT JOIN player p ON (p.id = g.player_id)
|
|
|
|
LEFT JOIN frame f ON (f.game_id = g.id)
|
|
|
|
WHERE (
|
|
|
|
f.id = (
|
|
|
|
SELECT id FROM frame WHERE game_id = g.id ORDER BY elapsed_time DESC LIMIT 1
|
|
|
|
)
|
|
|
|
)
|
|
|
|
GROUP BY g.id;
|
|
|
|
"
|