Skip to content

Commit

Permalink
Merge pull request #25948 from chetna1726/docs
Browse files Browse the repository at this point in the history
[ci skip] Add documentation for error using select with order
  • Loading branch information
rafaelfranca committed Jul 28, 2016
2 parents 410a214 + a9dabd6 commit 4211a29
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions guides/source/active_record_querying.md
Expand Up @@ -601,6 +601,7 @@ If you want to call `order` multiple times, subsequent orders will be appended t
Client.order("orders_count ASC").order("created_at DESC")
# SELECT * FROM clients ORDER BY orders_count ASC, created_at DESC
```
WARNING: If you are using **MySQL 5.7.5** and above, then on selecting fields from a result set using methods like `select`, `pluck` and `ids`; the `order` method will raise an `ActiveRecord::StatementInvalid` exception unless the field(s) used in `order` clause are included in the select list. See the next section for selecting fields from the result set.

Selecting Specific Fields
-------------------------
Expand Down

0 comments on commit 4211a29

Please sign in to comment.