Tag : MySQL Subquery


Laravel - How to make subquery in select statement?

Sometimes we require to make subquery inside the select statement in Laravel. At that time we are thinking how to select from subquery using in Laravel Query Builder. In this post i will give you example of subquery in select statement in Laravel 5 application from scratch. For subquery in select statement we are going to use <strong class="path">DB::raw()</strong>. DB raw function through we can simply make suquery join in Laravel Eloquent Query Builder. Here as bellow full example, i have three tables as listed bellow: <strong>1)products</strong> <strong>2)products_stock</strong> <strong.....

By Hardik Savani | February 6, 2017 | | 8813 Viewer | Category : Laravel MySql
READ MORE

Laravel 5 Join with subquery in Query Builder Example

In this post i want to show you how to use subquery with join in laravel query builder. Whenever you need to use subquery in your laravel project you can use following example and learn hot to use subquery. In bellow example you can see we add subquery using DB::raw(), DB::raw() throught we can select our subtable and after in second argument i added compare your field. That way you can easily fire subquery with laravel 5.2 query builder. <strong>Example:</strong> <pre class="language-sql"> $data = DB::table("items") ->select("items.*","items_count.price_group","items_count.quantity_group") .....

By Hardik Savani | March 2, 2016 | | 14268 Viewer | Category : PHP Laravel
READ MORE

    Laravel 5 generate sitemap using roumen/sitemap package Example

    Laravel 5 generate sitemap using roumen/sitemap package Example

    Open Post

    MySql comma separated column join in PHP Laravel 5

    MySql comma separated column join in PHP Laravel 5

    Open Post

    AngularJS - convert comma separated string to array example

    AngularJS - convert comma separated string to array example

    Open Post

    PHP - File upload progress bar with percentage using form jquery example

    PHP - File upload progress bar with percentage using form jquery example

    Open Post

    Select box with search option example in Jquery using Chosen Plugin

    Select box with search option example in Jquery using Chosen Plugin

    Open Post

    Laravel 5 - Bootstrap Admin Theme Integration example from scratch

    Laravel 5 - Bootstrap Admin Theme Integration example from scratch

    Open Post