Query:
select d.day as day, DATE_FORMAT(d.date,'%d/%m/%Y') as date,
d.day_of_week, tsc.name, tsc.id as tscday, weekday(DATE_ADD(d.date, INTERVAL 1 DAY)) as rw_day,
DATE_FORMAT(d.game_date,'%d/%m/%Y') as game_date
from days d, tournament_schedule tsc
where tsc.day = d.day
and d.day >= '11388' and d.day <= '11388' + 50 - 1
group by d.day, tsc.id
order by day
error: Out of resources when opening file './fb/tournament_schedule.MYD' (Errcode: 24)