Skip to content

Commit

Permalink
Merge pull request #2180 from jim-parry/fix-qbdocs
Browse files Browse the repository at this point in the history
Fix query builder user guide page
  • Loading branch information
jim-parry authored Sep 3, 2019
2 parents f9b4f48 + 7e8165b commit 0318e2e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions user_guide_src/source/database/query_builder.rst
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ selectMax(), You can optionally include a second parameter to rename
the resulting field.

.. note:: This method is particularly helpful when used with ``groupBy()``. For
counting results generally see ``countAll()`` or ``countAllResults()``.
counting results generally see ``countAll()`` or ``countAllResults()``.

::

Expand Down Expand Up @@ -297,7 +297,8 @@ methods:

#. **Subqueries:**
You can use an anonymous function to create a subquery.
::

::

$builder->where('advance_amount <', function(BaseBuilder $builder) {
return $builder->select('MAX(advance_amount)', false)->from('orders')->where('id >', 2);
Expand All @@ -307,7 +308,9 @@ methods:
**$builder->orWhere()**

This function is identical to the one above, except that multiple
instances are joined by OR::
instances are joined by OR

::

$builder->where('name !=', $name);
$builder->orWhere('id >', $id); // Produces: WHERE name != 'Joe' OR id > 50
Expand All @@ -330,7 +333,6 @@ You can use subqueries instead of an array of values.
$builder->whereIn('id', function(BaseBuilder $builder) {
return $builder->select('job_id')->from('users_jobs')->where('user_id', 3);
});

// Produces: WHERE "id" IN (SELECT "job_id" FROM "users_jobs" WHERE "user_id" = 3)

**$builder->orWhereIn()**
Expand Down

0 comments on commit 0318e2e

Please sign in to comment.