我正在Laravel中运行选择查询以进行计数。但我只想对一个字段进行分组
我已编写查询
$games = DB::table('game_point')
->select(
'game_point.game_name',
'game_point.point_assigned',
DB::raw("DATE(game_point.created_at) as created_at"),
DB::raw("COUNT(played_game.user_id) as total_users")
)
->join("played_game","played_game.game","=","game_point.game_name")
->groupBy("played_game.game", "game_point.game_name")
->paginate(15);
我只想分组
game_point.game_name
,而不是所有选定的字段。但是有错误