I have an inexplicable syntaxe error in my laravel query.
My query in php:
$data['bassin'] = DB::table('previsionrdt.rdt', 'previsionrdt.bc')
->select ('id_bc', DB::raw('SUM(surf_rpg17) as sum_surf'))
->from ('previsionrdt.rdt', 'p')
->join ('previsionrdt.bc', 'c', 'on', 'c.gid', '=', 'p.id_bc')
->groupBy ('id_bc')
->get();
My query in pgAdmin :
select id_bc, sum(surf_rpg17) as sum_surf
from previsionrdt.rdt p
join previsionrdt.bc c on c.gid = p.id_bc
group by id_bc
When I test the code it says that there is a syntaxe error on the join line and I don't know where the error is coming from.