I have a database in which there is a user table & how many time they reward record table I wanna result like this (WEEK WISE)
user_name user_week user_reward
abc 24,25,26 4,5,6
My query is like this
SELECT WEEK(cpd.added_date),COUNT(cpd.result)
FROM cron_players_data cpd WHERE cpd.player_id = 81
AND cpd.result = 2 AND cpd.status = 1
GROUP BY WEEK(cpd.added_date);
And Result is
user_name user_week user_reward
abc 24 4
abc 24 5
abc 24 6
i use group_concat with count but its useless is there any alternate method for this desire result