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 | | 3760 Viewer | Category : Laravel
READ MORE

    How to create custom helper in Laravel 5?

    How to create custom helper in Laravel 5?

    Open Post

    Laravel 5 - category treeview hierarchical structure example with demo

    Laravel 5 - category treeview hierarchical structure example with demo

    Open Post

    Laravel 5 - Implement Flash Messages with example

    Laravel 5 - Implement Flash Messages with example

    Open Post

    PHP - autocomplete websites with domain and logo using clearbit API

    PHP - autocomplete websites with domain and logo using clearbit API

    Open Post

    How to create quick apache virtual host in Ubuntu?

    How to create quick apache virtual host in Ubuntu?

    Open Post

    Dynamic Autocomplete search using Bootstrap Typeahead JS Example

    Dynamic Autocomplete search using Bootstrap Typeahead JS Example

    Open Post