# sqlalchemy 2.1.9 (MIT), harvested by tools/harvest_corpus.py
=== input
Return a new :func:`_expression.select` construct which
        will apply DISTINCT to the SELECT statement overall.

        E.g.::

            from sqlalchemy import select

            stmt = select(users_table.c.id, users_table.c.name).distinct()

        The above would produce an statement resembling:

        .. sourcecode:: sql

            SELECT DISTINCT user.id, user.name FROM user

        The method also historically accepted an ``*expr`` parameter which
        produced the PostgreSQL dialect-specific ``DISTINCT ON`` expression.
        This is now replaced using the :func:`_postgresql.distinct_on`
        extension::

            from sqlalchemy import select
            from sqlalchemy.dialects.postgresql import distinct_on

            stmt = select(users_table).ext(distinct_on(users_table.c.name))

        Using this parameter on other backends which don't support this
        syntax will raise an error.

        :param \*expr: optional column expressions.  When present,
         the PostgreSQL dialect will render a ``DISTINCT ON (<expressions>)``
         construct.  A deprecation warning and/or :class:`_exc.CompileError`
         will be raised on other backends.

         .. deprecated:: 2.1 Passing expressions to
           :meth:`_sql.Select.distinct` is deprecated, use
           :func:`_postgresql.distinct_on` instead.

         .. deprecated:: 1.4 Using \*expr in other dialects is deprecated
            and will raise :class:`_exc.CompileError` in a future version.

        .. seealso::

            :func:`_postgresql.distinct_on`

            :meth:`.ext`
        
=== parse rest
short_description: |
  Return a new :func:`_expression.select` construct which
  will apply DISTINCT to the SELECT statement overall.
long_description: |
  E.g.::
  
      from sqlalchemy import select
  
      stmt = select(users_table.c.id, users_table.c.name).distinct()
  
  The above would produce an statement resembling:
  
  .. sourcecode:: sql
  
      SELECT DISTINCT user.id, user.name FROM user
  
  The method also historically accepted an ``*expr`` parameter which
  produced the PostgreSQL dialect-specific ``DISTINCT ON`` expression.
  This is now replaced using the :func:`_postgresql.distinct_on`
  extension::
  
      from sqlalchemy import select
      from sqlalchemy.dialects.postgresql import distinct_on
  
      stmt = select(users_table).ext(distinct_on(users_table.c.name))
  
  Using this parameter on other backends which don't support this
  syntax will raise an error.
  
  .. seealso::
  
      :func:`_postgresql.distinct_on`
  
      :meth:`.ext`
blank_after_short_description: True
blank_after_long_description: True
style: rest
- DocstringParam
  description: |
    optional column expressions.  When present,
    the PostgreSQL dialect will render a ``DISTINCT ON (<expressions>)``
    construct.  A deprecation warning and/or :class:`_exc.CompileError`
    will be raised on other backends.
    
    .. deprecated:: 2.1 Passing expressions to
      :meth:`_sql.Select.distinct` is deprecated, use
      :func:`_postgresql.distinct_on` instead.
    
    .. deprecated:: 1.4 Using \*expr in other dialects is deprecated
       and will raise :class:`_exc.CompileError` in a future version.
  kind: param
  key: 'param'
  arg_name: '*expr'
  is_optional: False
=== detect
rest
=== compose rest
Return a new :func:`_expression.select` construct which
will apply DISTINCT to the SELECT statement overall.

E.g.::

    from sqlalchemy import select

    stmt = select(users_table.c.id, users_table.c.name).distinct()

The above would produce an statement resembling:

.. sourcecode:: sql

    SELECT DISTINCT user.id, user.name FROM user

The method also historically accepted an ``*expr`` parameter which
produced the PostgreSQL dialect-specific ``DISTINCT ON`` expression.
This is now replaced using the :func:`_postgresql.distinct_on`
extension::

    from sqlalchemy import select
    from sqlalchemy.dialects.postgresql import distinct_on

    stmt = select(users_table).ext(distinct_on(users_table.c.name))

Using this parameter on other backends which don't support this
syntax will raise an error.

.. seealso::

    :func:`_postgresql.distinct_on`

    :meth:`.ext`

:param \*expr: optional column expressions.  When present,
    the PostgreSQL dialect will render a ``DISTINCT ON (<expressions>)``
    construct.  A deprecation warning and/or :class:`_exc.CompileError`
    will be raised on other backends.

    .. deprecated:: 2.1 Passing expressions to
      :meth:`_sql.Select.distinct` is deprecated, use
      :func:`_postgresql.distinct_on` instead.

    .. deprecated:: 1.4 Using \*expr in other dialects is deprecated
       and will raise :class:`_exc.CompileError` in a future version.
