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 | | 28822 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 | | 40404 Viewer | Category : PHP Laravel
READ MORE

    How to integrate paypal payment gateway with laravel 5.4

    How to integrate paypal payment gateway with laravel 5.4

    Open Post

    How to implement infinite ajax scroll pagination in Laravel 5?

    How to implement infinite ajax scroll pagination in Laravel 5?

    Open Post

    Laravel 5 create word document file using phpoffice/phpword package

    Laravel 5 create word document file using phpoffice/phpword package

    Open Post

    Codeigniter 3 - Generate PDF from view using dompdf library with example

    Codeigniter 3 - Generate PDF from view using dompdf library with example

    Open Post

    How to integrate google map using gmaps.js in php example?

    How to integrate google map using gmaps.js in php example?

    Open Post

    Laravel 5 - How to get difference of time in minutes?

    Laravel 5 - How to get difference of time in minutes?

    Open Post