I think you need to first change your int(11)
value to date
and then use the Week
function ie,
select WEEK(DATE(dateid)) as weeknum, game ,count(*)
from table
DEMO
EDIT:-
As per your comments you may try to use
select concat('last ' ,(WEEK(dateid,1) -WEEK(CURDATE(),1)),' week',' ' )
DEMO
Also check the WEEK function in detail.
The two-argument form of WEEK() enables you to specify whether the
week starts on Sunday or Monday and whether the return value should be
in the range from 0 to 53 or from 1 to 53. If the mode argument is
omitted, the value of the default_week_format system variable is used.
Also see this list for reference:
M F.day Range Week 1 is the first week …
0 Sunday 0-53 with a Sunday in this year
1 Monday 0-53 with more than 3 days this year
2 Sunday 1-53 with a Sunday in this year
3 Monday 1-53 with more than 3 days this year
4 Sunday 0-53 with more than 3 days this year
5 Monday 0-53 with a Monday in this year
6 Sunday 1-53 with more than 3 days this year
7 Monday 1-53 with a Monday in this year
M = Mode
F.day = First day of week