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 | | 11340 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 | | 25913 Viewer | Category : PHP Laravel
READ MORE

    Laravel 5 - Paypal Payment Integration example using netshell/paypal package from scratch

    Laravel 5 - Paypal Payment Integration example using netshell/paypal package from scratch

    Open Post

    Laravel 5 - Simple user access control using Middleware

    Laravel 5 - Simple user access control using Middleware

    Open Post

    How to create Laravel Resource Controller example?

    How to create Laravel Resource Controller example?

    Open Post

    Mailgun setup with Laravel 5 example

    Mailgun setup with Laravel 5 example

    Open Post

    How to check current password using hash check in Laravel 5.3?

    How to check current password using hash check in Laravel 5.3?

    Open Post

    Solved - opencart this merchant is not enabled for auth/settle

    Solved - opencart this merchant is not enabled for auth/settle

    Open Post