decimal to integer group by query in laravel

 $chapter= array();
  $chapter = DB::table('Table_Name')->select( DB::raw('format(number,0) as chapter'), DB::raw('count(*) as total'))->groupBy(\DB::raw('format(number,0)'))->get(); 


Leave a Reply