on master help sign in
Document distinct
d469c77Ollie Charles
src/Rel8/Query/Distinct.hs+5
@@ -23,6 +23,11 @@ import Rel8.Table.Eq ( EqTable )
23import Rel8.Table.Opaleye ( distinctspec, unpackspec )
23import Rel8.Table.Opaleye ( distinctspec, unpackspec )
24
24
25
25
26+-- | Select all distinct rows from a query, removing duplicates. @distinct q@
27+-- is equivalent to the SQL statement @SELECT DISTINCT q@.
28+--
29+-- >>> select c $ distinct $ values [ lit True, lit True, lit False ]
30+-- [False,True]
26distinct :: EqTable a => Query a -> Query a
31distinct :: EqTable a => Query a -> Query a
27distinct = mapOpaleye (Opaleye.distinctExplicit distinctspec)
32distinct = mapOpaleye (Opaleye.distinctExplicit distinctspec)
28
33