Skip to content

Commit

Permalink
Correct the limitation about order with distinct in the guide
Browse files Browse the repository at this point in the history
That is happened with `distinct`, and that is not only happened on MyS
L, but also on PostgreSQL, SQL Server, and Oracle.

[ci skip]
  • Loading branch information
kamipo committed Mar 7, 2019
1 parent cece9ea commit 4ad4de5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion guides/source/active_record_querying.md
Expand Up @@ -611,7 +611,8 @@ 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.

WARNING: In most database systems, on selecting fields with `distinct` 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 4ad4de5

Please sign in to comment.