0

I'm trying to pull a rate from currencies_rates table with JOIN, but when I run the query it throws error "[HY000][1114] The table '' is full". What am I doing wrong?

SELECT
    game_id,
    u.country,
    COUNT(*) as count,
    SUM(IF(currency = 'EUR', (bet * cr.rate), bet)) as total_bets
FROM
    games_stats
    INNER JOIN users u on games_stats.user_id = u.id
    JOIN currencies_rates cr ON cr.to = 'EUR'
WHERE
    u.country IS NOT NULL
GROUP BY
    game_id,
    user_id
ORDER BY
    total_bets DESC;

Table currencies_rates

enter image description here

Table games_stats

enter image description here

WOUNDEDStevenJones
  • 5,150
  • 6
  • 41
  • 53
  • Does this answer your question? [1114 (HY000): The table is full](https://stackoverflow.com/questions/730579/1114-hy000-the-table-is-full) or https://stackoverflow.com/questions/21850287/error-1114-hy000-the-table-xxx-is-full or https://stackoverflow.com/questions/33670077/error-1114-the-table-is-full or https://dba.stackexchange.com/questions/43503/error-1114-hy000-the-table-is-full-with-innodb-file-per-table-set-to-aut – WOUNDEDStevenJones Jun 28 '22 at 17:08
  • This doesn't pertain to your question, but `JOIN currencies_rates cr ON cr.to = 'EUR'` would make more sense as a condition in the `WHERE` clause: `WHERE currencies_rates.to = 'EUR'` – devlin carnate Jun 28 '22 at 17:14
  • @devlincarnate what do you mean? – Dmitry Ivanoff Jun 28 '22 at 17:16
  • @WOUNDEDStevenJones not really – Dmitry Ivanoff Jun 28 '22 at 17:18
  • I mean, your join on currencies_rates could be more explicit. The way you have it written, it looks more like a WHERE condition than a JOIN because you aren't joining two tables. I don't know the structure of your tables, so I can't offer anything more than a generic suggestion. – devlin carnate Jun 28 '22 at 17:19
  • When you say "not really", do you mean you've read through and tried every answer on those questions? All of them seem to point to a disk-related issue specific to your computer or database config. It might be easier to help if you could follow some steps under "Help others reproduce the problem" (https://stackoverflow.com/help/how-to-ask) on a site like https://www.db-fiddle.com/. Though I suspect it's a local issue related to disk space that won't be reproducible with an external DB sandbox. – WOUNDEDStevenJones Jun 28 '22 at 17:54

0 Answers0