@@ -554,9 +554,9 @@ select_ = select . List
554-- be subject to the elimination of duplicate rows using `selectDistinct`.
554-- be subject to the elimination of duplicate rows using `selectDistinct`.
555selectDistinct
555selectDistinct
556 :: (SListI columns, columns ~ (col ': cols))
556 :: (SListI columns, columns ~ (col ': cols))
557− => Selection outer commons 'Ungrouped schemas params from columns
557+ => Selection outer commons grp schemas params from columns
558 -- ^ selection
558 -- ^ selection
559− -> TableExpression outer commons 'Ungrouped schemas params from
559+ -> TableExpression outer commons grp schemas params from
560 -- ^ intermediate virtual table
560 -- ^ intermediate virtual table
561 -> Query outer commons schemas params columns
561 -> Query outer commons schemas params columns
562selectDistinct selection tabexpr = UnsafeQuery $
562selectDistinct selection tabexpr = UnsafeQuery $
@@ -568,9 +568,9 @@ selectDistinct selection tabexpr = UnsafeQuery $
568-- of a general `Selection`.
568-- of a general `Selection`.
569selectDistinct_
569selectDistinct_
570 :: (SListI columns, columns ~ (col ': cols))
570 :: (SListI columns, columns ~ (col ': cols))
571− => NP (Aliased (Expression outer commons 'Ungrouped schemas params from)) columns
571+ => NP (Aliased (Expression outer commons grp schemas params from)) columns
572 -- ^ select list
572 -- ^ select list
573− -> TableExpression outer commons 'Ungrouped schemas params from
573+ -> TableExpression outer commons grp schemas params from
574 -- ^ intermediate virtual table
574 -- ^ intermediate virtual table
575 -> Query outer commons schemas params columns
575 -> Query outer commons schemas params columns
576selectDistinct_ = selectDistinct . List
576selectDistinct_ = selectDistinct . List
@@ -580,14 +580,16 @@ selectDistinct_ = selectDistinct . List
580the given expressions evaluate to equal. The DISTINCT ON expressions are
580the given expressions evaluate to equal. The DISTINCT ON expressions are
581interpreted using the same rules as for ORDER BY. ORDER BY is used to
581interpreted using the same rules as for ORDER BY. ORDER BY is used to
582ensure that the desired row appears first.
582ensure that the desired row appears first.
584+The DISTINCT ON expressions will be pre-appended to the ORDER BY clause.
584selectDistinctOn
586selectDistinctOn
585 :: (SListI columns, columns ~ (col ': cols))
587 :: (SListI columns, columns ~ (col ': cols))
586− => [SortExpression outer commons 'Ungrouped schemas params from]
588+ => [SortExpression outer commons grp schemas params from]
587 -- ^ distinct on and return the first row in ordering
589 -- ^ distinct on and return the first row in ordering
588− -> Selection outer commons 'Ungrouped schemas params from columns
590+ -> Selection outer commons grp schemas params from columns
589 -- ^ selection
591 -- ^ selection
590− -> TableExpression outer commons 'Ungrouped schemas params from
592+ -> TableExpression outer commons grp schemas params from
591 -- ^ intermediate virtual table
593 -- ^ intermediate virtual table
592 -> Query outer commons schemas params columns
594 -> Query outer commons schemas params columns
593selectDistinctOn distincts selection tab = UnsafeQuery $
595selectDistinctOn distincts selection tab = UnsafeQuery $
@@ -608,11 +610,11 @@ selectDistinctOn distincts selection tab = UnsafeQuery $
608-- of a general `Selection`.
610-- of a general `Selection`.
609selectDistinctOn_
611selectDistinctOn_
610 :: (SListI columns, columns ~ (col ': cols))
612 :: (SListI columns, columns ~ (col ': cols))
611− => [SortExpression outer commons 'Ungrouped schemas params from]
613+ => [SortExpression outer commons grp schemas params from]
612 -- ^ distinct on and return the first row in ordering
614 -- ^ distinct on and return the first row in ordering
613− -> NP (Aliased (Expression outer commons 'Ungrouped schemas params from)) columns
615+ -> NP (Aliased (Expression outer commons grp schemas params from)) columns
614 -- ^ selection
616 -- ^ selection
615− -> TableExpression outer commons 'Ungrouped schemas params from
617+ -> TableExpression outer commons grp schemas params from
616 -- ^ intermediate virtual table
618 -- ^ intermediate virtual table
617 -> Query outer commons schemas params columns
619 -> Query outer commons schemas params columns
618selectDistinctOn_ distincts = selectDistinctOn distincts . List
620selectDistinctOn_ distincts = selectDistinctOn distincts . List