Closed ChrisReid closed 10 years ago
DB::raw is problematic usage for this package. But this may work:
select(array(
'teams.id','teams.country',
DB::Raw('(select max(no_draw_streak) from draws where draws.team_id = teams.id) as max_no_draw_streak '),
DB::Raw('(select avg(no_draw_streak) from draws where draws.team_id = teams.id) as avg_no_draw_streak')
));
as @bllim noted, this each raw column needs to be passed individually into the select
Example:
produces this SQL: