Skip to content

Commit 3b3bb2e

Browse files
authored
Merge pull request piccolo-orm#149 from aminalaee/add-distinct-method-docs
add distinct method docs
2 parents 8e1b621 + 35d7e9f commit 3b3bb2e

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.. _distinct:
2+
3+
distinct
4+
========
5+
6+
You can use ``distinct`` clauses with the following queries:
7+
8+
* :ref:`Select`
9+
10+
.. code-block:: python
11+
12+
>>> Band.select(Band.name).distinct().run_sync()
13+
[{'title': 'Pythonistas'}]
14+
15+
This is equivalent to ``SELECT DISTINCT name FROM band`` in SQL.

docs/src/piccolo/query_types/select.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ Query clauses
172172
-------------
173173

174174
batch
175-
~~~~~~~
175+
~~~~~
176176

177177
See :ref:`batch`.
178178

@@ -228,6 +228,11 @@ offset
228228

229229
See  :ref:`offset`.
230230

231+
distinct
232+
~~~~~~~~
233+
234+
See  :ref:`distinct`.
235+
231236
order_by
232237
~~~~~~~~
233238

0 commit comments

Comments
 (0)