diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2016-07-28 01:16:41 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-28 01:16:41 -0300 |
commit | 4211a29902eac95e67e9fed2b9dfce7a1f1d2799 (patch) | |
tree | 3702533d6683511ad8771fbc67ebd3e329781f26 /guides/source | |
parent | 410a21416ee2817aeea653d48f624d390f336b5f (diff) | |
parent | a9dabd6939f99148750854b09bbb0eeeaed21d51 (diff) | |
download | rails-4211a29902eac95e67e9fed2b9dfce7a1f1d2799.tar.gz rails-4211a29902eac95e67e9fed2b9dfce7a1f1d2799.tar.bz2 rails-4211a29902eac95e67e9fed2b9dfce7a1f1d2799.zip |
Merge pull request #25948 from chetna1726/docs
[ci skip] Add documentation for error using select with order
Diffstat (limited to 'guides/source')
-rw-r--r-- | guides/source/active_record_querying.md | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/guides/source/active_record_querying.md b/guides/source/active_record_querying.md index 90f200133b..8ffd0d033d 100644 --- a/guides/source/active_record_querying.md +++ b/guides/source/active_record_querying.md @@ -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 ------------------------- |