[Postgres] Add support for DISTINCT ON clause.
This commit is contained in:
parent
5cbf4aac86
commit
6fe9c26d30
3 changed files with 69 additions and 4 deletions
|
|
@ -44,7 +44,7 @@ type SelectStatement interface {
|
|||
jet.HasProjections
|
||||
Expression
|
||||
|
||||
DISTINCT() SelectStatement
|
||||
DISTINCT(on ...jet.ColumnExpression) SelectStatement
|
||||
FROM(tables ...ReadableTable) SelectStatement
|
||||
WHERE(expression BoolExpression) SelectStatement
|
||||
GROUP_BY(groupByClauses ...GroupByClause) SelectStatement
|
||||
|
|
@ -104,8 +104,9 @@ type selectStatementImpl struct {
|
|||
For jet.ClauseFor
|
||||
}
|
||||
|
||||
func (s *selectStatementImpl) DISTINCT() SelectStatement {
|
||||
func (s *selectStatementImpl) DISTINCT(on ...jet.ColumnExpression) SelectStatement {
|
||||
s.Select.Distinct = true
|
||||
s.Select.DistinctOnColumns = on
|
||||
return s
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue