From 1ee6710b54c013d31951ce22c74ac72377ebbbf6 Mon Sep 17 00:00:00 2001 From: Jason Kurian Date: Wed, 22 Feb 2017 18:20:06 -0500 Subject: docs: add distinct to README --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index 292b7fdbca..2872589524 100644 --- a/README.md +++ b/README.md @@ -150,7 +150,14 @@ The `OR` operator works like this: users.where(users[:name].eq('bob').or(users[:age].lt(25))) ``` -The `AND` operator behaves similarly. +The `AND` operator behaves similarly. The exception is the `DISTINCT` operator, which is not chainable: + +``` +posts = Arel::Table.new(:posts) +posts.project(posts[:title]) +posts.distinct +posts.to_sql # => 'SELECT DISTINCT "posts"."title" FROM "posts"' +``` Aggregate functions `AVG`, `SUM`, `COUNT`, `MIN`, `MAX`, `HAVING`: -- cgit v1.2.3