summaryrefslogtreecommitdiff
path: root/README.markdown
diff options
context:
space:
mode:
authorJamie Matthews <[email protected]>2011-01-22 11:08:47 +0000
committerJamie Matthews <[email protected]>2011-01-22 11:08:47 +0000
commit8b92b3019821f5f619a95a0b58b62e3bb43dd455 (patch)
treec81d963bf8c8658fcff4024e04204399a2461d59 /README.markdown
parent68a66e0b0a1b89af4fcd1e8cad9c1b988c92ce07 (diff)
Add support for DISTINCT - issue #13
Diffstat (limited to 'README.markdown')
-rw-r--r--README.markdown10
1 files changed, 10 insertions, 0 deletions
diff --git a/README.markdown b/README.markdown
index 995f46c..305c745 100644
--- a/README.markdown
+++ b/README.markdown
@@ -225,6 +225,16 @@ Will result in the query:
SELECT COUNT(*) AS `count` FROM `person`;
+#### DISTINCT ####
+
+To add a `DISTINCT` keyword before the list of result columns in your query, add a call to `distinct()` to your query chain.
+
+ $distinct_names = ORM::for_table('person')->distinct()->select('name')->find_many();
+
+This will result in the query:
+
+ SELECT DISTINCT `name` FROM `person`;
+
#### Joins ####
Idiorm has a family of methods for adding different types of `JOIN`s to the queries it constructs: