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 | | 40637 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 | | 47834 Viewer | Category : PHP Laravel
READ MORE

    Laravel 5 Autocomplete using Bootstrap Typeahead JS Example with Demo

    Laravel 5 Autocomplete using Bootstrap Typeahead JS Example with Demo

    Open Post

    AngularJS - convert comma separated string to array example

    AngularJS - convert comma separated string to array example

    Open Post

    How to create custom facade in laravel 5.2?

    How to create custom facade in laravel 5.2?

    Open Post

    PHP - Input multiple tags with dynamic autocomplete example

    PHP - Input multiple tags with dynamic autocomplete example

    Open Post

    Automatically Refresh or Reload a Page using jQuery Example

    Automatically Refresh or Reload a Page using jQuery Example

    Open Post

    Laravel 5 - Column sorting with pagination example from scratch

    Laravel 5 - Column sorting with pagination example from scratch

    Open Post