Skip to content

Ability to generate queries with distinct/group by #915

Closed
@daurnimator

Description

@daurnimator

PostgREST should have a way to perform a SELECT DISTINCT query.

I suggest a new reserved query word 'distinct'.

  • With no value it would just do a select distinct e.g. /mytable?distinct
  • Otherwise it is a comma separated list of columns (or computed columns) which would be used inside of SELECT DISTINCT ON(....) e.g. /mytable?distinct=name would be SELECT DISTINCT ON(name) * FROM mytable

Note that the columns that you are distinct on will also need to have order applied.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementa feature, ready for implementation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions