Tag : SUM()



Laravel 5 select with sum query example

We mostly required to get sum of amount, salary etc in laravel. We can also get sum of column using mysql SUM(). We have two way to get sum of column value. first we can use laravel sum() of query builder and another one we can use with directly with select statement using DB::raw(). I give you both example you can see and use any one as perfect for you. <strong>Example 1:</strong> <pre class="prettyprint lang-php"> $data = DB::table("click")->sum('numberofclick'); print_r($data); </pre> <strong>Example 2:</strong> <pre class="prettyprint lang-php"> $data = DB::table("click") ->select(DB.....

By Hardik Savani | June 8, 2016 | | 35380 Viewer | Category : Laravel
READ MORE

    Bootstrap progress bar animate example using bootstrap-progressbar.js

    Bootstrap progress bar animate example using bootstrap-progressbar.js

    Open Post

    Response download with file in Laravel 5.3 example

    Response download with file in Laravel 5.3 example

    Open Post

    Jquery - Display a loading gif image before a image loads using Eager ImageLoader plugin

    Jquery - Display a loading gif image before a image loads using Eager ImageLoader plugin

    Open Post

    Laravel - How to make subquery in select statement?

    Laravel - How to make subquery in select statement?

    Open Post

    Laravel 5 - Generate Captcha code and Validation example using BotDetect package

    Laravel 5 - Generate Captcha code and Validation example using BotDetect package

    Open Post

    How to create custom facade in laravel 5.2?

    How to create custom facade in laravel 5.2?

    Open Post