class documentation

Represents a ``SELECT`` statement. The :class:`_sql.Select` object is normally constructed using the :func:`_sql.select` function. See that function for details. .. seealso:: :func:`_sql.select` :ref:`tutorial_selecting_data` - in the 2.0 tutorial

Method __init__ Construct a new :class:`_expression.Select`.
Method add_columns Return a new :func:`_expression.select` construct with the given entities appended to its columns clause.
Method column Return a new :func:`_expression.select` construct with the given column expression added to its columns clause.
Method correlate Return a new :class:`_expression.Select` which will correlate the given FROM clauses to that of an enclosing :class:`_expression.Select`.
Method correlate_except Return a new :class:`_expression.Select` which will omit the given FROM clauses from the auto-correlation process.
Method distinct Return a new :func:`_expression.select` construct which will apply DISTINCT to its columns clause.
Method except_ Return a SQL ``EXCEPT`` of this select() construct against the given selectable provided as positional arguments.
Method except_all Return a SQL ``EXCEPT ALL`` of this select() construct against the given selectables provided as positional arguments.
Method filter A synonym for the :meth:`_sql.Select.where` method.
Method filter_by apply the given filtering criterion as a WHERE clause to this select.
Method from_statement Apply the columns which this :class:`.Select` would select onto another statement.
Method get_children Return immediate child :class:`.visitors.HasTraverseInternals` elements of this :class:`.visitors.HasTraverseInternals`.
Method get_final_froms Compute the final displayed list of :class:`_expression.FromClause` elements.
Method having Return a new :func:`_expression.select` construct with the given expression added to its HAVING clause, joined to the existing clause via AND, if any.
Method intersect Return a SQL ``INTERSECT`` of this select() construct against the given selectables provided as positional arguments.
Method intersect_all Return a SQL ``INTERSECT ALL`` of this select() construct against the given selectables provided as positional arguments.
Method is_derived_from Return ``True`` if this :class:`.ReturnsRows` is 'derived' from the given :class:`.FromClause`.
Method join Create a SQL JOIN against this :class:`_expression.Select` object's criterion and apply generatively, returning the newly resulting :class:`_expression.Select`.
Method join_from Create a SQL JOIN against this :class:`_expression.Select` object's criterion and apply generatively, returning the newly resulting :class:`_expression.Select`.
Method outerjoin Create a left outer join.
Method outerjoin_from Create a SQL LEFT OUTER JOIN against this :class:`_expression.Select` object's criterion and apply generatively, returning the newly resulting :class:`_expression.Select`.
Method reduce_columns Return a new :func:`_expression.select` construct with redundantly named, equivalently-valued columns removed from the columns clause.
Method scalar_subquery Return a 'scalar' representation of this selectable, which can be used as a column expression.
Method select_from Return a new :func:`_expression.select` construct with the given FROM expression(s) merged into its list of FROM objects.
Method selected_columns A :class:`_expression.ColumnCollection` representing the columns that this SELECT statement or similar construct returns in its result set, not including :class:`_sql.TextClause` constructs.
Method self_group Apply a 'grouping' to this :class:`_expression.ClauseElement`.
Method union Return a SQL ``UNION`` of this select() construct against the given selectables provided as positional arguments.
Method union_all Return a SQL ``UNION ALL`` of this select() construct against the given selectables provided as positional arguments.
Method where Return a new :func:`_expression.select` construct with the given expression added to its WHERE clause, joined to the existing clause via AND, if any.
Method with_only_columns Return a new :func:`_expression.select` construct with its columns clause replaced with the given entities.
Class Variable __visit_name__ Undocumented
Property column_descriptions Return a :term:`plugin-enabled` 'column descriptions' structure referring to the columns which are SELECTed by this statement.
Property columns_clause_froms Return the set of :class:`_expression.FromClause` objects implied by the columns clause of this SELECT statement.
Property froms Return the displayed list of :class:`_expression.FromClause` elements.
Property inner_columns An iterator of all :class:`_expression.ColumnElement` expressions which would be rendered into the columns clause of the resulting SELECT statement.
Property whereclause Return the completed WHERE clause for this :class:`_expression.Select` statement.
Class Method _create_raw_select Create a :class:`.Select` using raw ``__new__`` with no coercions.
Method _all_selected_columns A sequence of expressions that correspond to what is rendered in the columns clause, including :class:`_sql.TextClause` constructs.
Method _copy_internals Reassign internal elements to be clones of themselves.
Method _ensure_disambiguated_names Ensure that the names generated by this selectbase will be disambiguated in some way, if possible.
Method _filter_by_zero Undocumented
Method _generate_fromclause_column_proxies Generate column proxies to place in the exported ``.c`` collection of a subquery.
Method _needs_parens_for_grouping Undocumented
Method _scalar_type Undocumented
Method _set_entities Undocumented
Class Variable _cache_key_traversal Undocumented
Class Variable _compile_state_factory Undocumented
Class Variable _having_criteria Undocumented
Class Variable _is_select_statement Undocumented
Class Variable _memoized_select_entities Undocumented
Class Variable _setup_joins Undocumented
Class Variable _traverse_internals Undocumented
Class Variable _where_criteria Undocumented
Instance Variable _auto_correlate Undocumented
Instance Variable _correlate Undocumented
Instance Variable _correlate_except Undocumented
Instance Variable _distinct Undocumented
Instance Variable _distinct_on Undocumented
Instance Variable _from_obj Undocumented
Instance Variable _raw_columns Undocumented

Inherited from HasPrefixes:

Method prefix_with Add one or more expressions following the statement keyword, i.e. SELECT, INSERT, UPDATE, or DELETE. Generative.
Class Variable _has_prefixes_traverse_internals Undocumented
Instance Variable _prefixes Undocumented

Inherited from HasSuffixes (via HasPrefixes):

Method suffix_with Add one or more expressions following the statement as a whole.
Class Variable _has_suffixes_traverse_internals Undocumented
Instance Variable _suffixes Undocumented

Inherited from HasHints (via HasPrefixes, HasSuffixes):

Method with_hint Add an indexing or other executional context hint for the given selectable to this :class:`_expression.Select` or other selectable object.
Method with_statement_hint Add a statement hint to this :class:`_expression.Select` or other selectable object.
Method _with_hint Undocumented
Class Variable _has_hints_traverse_internals Undocumented
Class Variable _hints Undocumented
Class Variable _statement_hints Undocumented

Inherited from HasCompileState (via HasPrefixes, HasSuffixes, HasHints):

Class Variable _compile_state_plugin Undocumented

Inherited from _SelectFromElements (via HasPrefixes, HasSuffixes, HasHints, HasCompileState):

Class Variable __slots__ Undocumented
Method _iterate_from_elements Undocumented

Inherited from GenerativeSelect (via HasPrefixes, HasSuffixes, HasHints, HasCompileState, _SelectFromElements):

Method fetch Return a new selectable with the given FETCH FIRST criterion applied.
Method get_label_style Retrieve the current label style.
Method group_by Return a new selectable with the given list of GROUP BY criterion applied.
Method limit Return a new selectable with the given LIMIT criterion applied.
Method offset Return a new selectable with the given OFFSET criterion applied.
Method order_by Return a new selectable with the given list of ORDER BY criteria applied.
Method set_label_style Return a new selectable with the specified label style.
Method slice Apply LIMIT / OFFSET to this statement based on a slice.
Method with_for_update Specify a ``FOR UPDATE`` clause for this :class:`_expression.GenerativeSelect`.
Method _offset_or_limit_clause Convert the given value to an "offset or limit" clause.
Method _offset_or_limit_clause_asint Convert the "offset or limit" clause of a select construct to an integer.
Method _simple_int_clause True if the clause is a simple integer, False if it is not present or is a SQL expression.
Instance Variable _fetch_clause Undocumented
Instance Variable _fetch_clause_options Undocumented
Instance Variable _for_update_arg Undocumented
Instance Variable _group_by_clauses Undocumented
Instance Variable _label_style Undocumented
Instance Variable _limit_clause Undocumented
Instance Variable _offset_clause Undocumented
Instance Variable _order_by_clauses Undocumented
Property _group_by_clause ClauseList access to group_by_clauses for legacy dialects
Property _has_row_limiting_clause Undocumented
Property _limit Get an integer value for the limit. This should only be used by code that cannot support a limit as a BindParameter or other custom clause as it will throw an exception if the limit isn't currently set to an integer.
Property _offset Get an integer value for the offset. This should only be used by code that cannot support an offset as a BindParameter or other custom clause as it will throw an exception if the offset isn't currently set to an integer.
Property _order_by_clause ClauseList access to order_by_clauses for legacy dialects

Inherited from SelectBase (via HasPrefixes, HasSuffixes, HasHints, HasCompileState, _SelectFromElements, GenerativeSelect):

Method alias Return a named subquery against this :class:`_expression.SelectBase`.
Method as_scalar Undocumented
Method exists Return an :class:`_sql.Exists` representation of this selectable, which can be used as a column expression.
Method label Return a 'scalar' representation of this selectable, embedded as a subquery with a label.
Method lateral Return a LATERAL alias of this :class:`_expression.Selectable`.
Method select Undocumented
Method subquery Return a subquery of this :class:`_expression.SelectBase`.
Class Variable is_select Undocumented
Property c Undocumented
Property columns Undocumented
Property exported_columns A :class:`_expression.ColumnCollection` that represents the "exported" columns of this :class:`_expression.Selectable`, not including :class:`_sql.TextClause` constructs.
Method _implicit_subquery Undocumented
Method _refresh_for_new_column reset internal collections for an incoming column being added.
Class Variable _is_select_base Undocumented

Inherited from SelectStatementRole (via HasPrefixes, HasSuffixes, HasHints, HasCompileState, _SelectFromElements, GenerativeSelect, SelectBase):

Class Variable _role_name Undocumented

Inherited from Executable (via HasPrefixes, HasSuffixes, HasHints, HasCompileState, _SelectFromElements, GenerativeSelect, SelectBase, SelectStatementRole, TypedReturnsRows, ExecutableReturnsRows):

Method execution_options Set non-SQL options for the statement which take effect during execution.
Method get_execution_options Get the non-SQL options which will take effect during execution.
Method options Apply options to this statement.
Class Variable is_delete Undocumented
Class Variable is_dml Undocumented
Class Variable is_insert Undocumented
Class Variable is_text Undocumented
Class Variable is_update Undocumented
Class Variable supports_execution Undocumented
Method _add_context_option Add a context option to this statement.
Method _compile_w_cache Undocumented
Method _execute_on_connection Undocumented
Method _execute_on_scalar Undocumented
Method _set_compile_options Assign the compile options to a new value.
Method _update_compile_options update the _compile_options with new keys.
Class Variable _executable_traverse_internals Undocumented
Class Variable _is_default_generator Undocumented
Class Variable _with_context_options Undocumented
Class Variable _with_options Undocumented
Instance Variable _compile_options Undocumented
Instance Variable _execution_options Undocumented
Property _effective_plugin_target Undocumented

Inherited from StatementRole (via HasPrefixes, HasSuffixes, HasHints, HasCompileState, _SelectFromElements, GenerativeSelect, SelectBase, SelectStatementRole, TypedReturnsRows, ExecutableReturnsRows, Executable):

Property _propagate_attrs Undocumented

Inherited from AllowsLambdaRole (via HasPrefixes, HasSuffixes, HasHints, HasCompileState, _SelectFromElements, GenerativeSelect, SelectBase, SelectStatementRole, TypedReturnsRows, ExecutableReturnsRows, Executable, StatementRole, DMLSelectRole, CompoundElementRole):

Class Variable allows_lambda Undocumented

Inherited from HasCTE (via HasPrefixes, HasSuffixes, HasHints, HasCompileState, _SelectFromElements, GenerativeSelect, SelectBase, SelectStatementRole, TypedReturnsRows, ExecutableReturnsRows, Executable, StatementRole, DMLSelectRole, CompoundElementRole, AllowsLambdaRole, InElementRole):

Method add_cte Add one or more :class:`_sql.CTE` constructs to this statement.
Method cte Return a new :class:`_expression.CTE`, or Common Table Expression instance.
Class Variable _has_ctes_traverse_internals Undocumented
Class Variable _independent_ctes Undocumented
Class Variable _independent_ctes_opts Undocumented

Inherited from SelectsRows (via HasPrefixes, HasSuffixes, HasHints, HasCompileState, _SelectFromElements, GenerativeSelect, SelectBase, SelectStatementRole, TypedReturnsRows, ExecutableReturnsRows, Executable, StatementRole, DMLSelectRole, CompoundElementRole, AllowsLambdaRole, InElementRole, HasCTE, HasCTERole):

Method _generate_columns_plus_names Generate column names as rendered in a SELECT statement by the compiler.

Inherited from SupportsCloneAnnotations (via HasPrefixes, HasSuffixes, HasHints, HasCompileState, _SelectFromElements, GenerativeSelect, SelectBase, SelectStatementRole, TypedReturnsRows, ExecutableReturnsRows, Executable, StatementRole, DMLSelectRole, CompoundElementRole, AllowsLambdaRole, InElementRole, HasCTE, HasCTERole, SelectsRows):

Method _annotate return a copy of this ClauseElement with annotations updated by the given dictionary.
Method _deannotate return a copy of this :class:`_expression.ClauseElement` with annotations removed.
Method _with_annotations return a copy of this ClauseElement with annotations replaced by the given dictionary.
Class Variable _clone_annotations_traverse_internals Undocumented

Inherited from Selectable (via HasPrefixes, HasSuffixes, HasHints, HasCompileState, _SelectFromElements, GenerativeSelect, SelectBase, SelectStatementRole, TypedReturnsRows, ExecutableReturnsRows, Executable, StatementRole, DMLSelectRole, CompoundElementRole, AllowsLambdaRole, InElementRole, HasCTE, HasCTERole, SelectsRows, SupportsCloneAnnotations):

Method corresponding_column Given a :class:`_expression.ColumnElement`, return the exported :class:`_expression.ColumnElement` object from the :attr:`_expression.Selectable.exported_columns` collection of this :class:`_expression...
Method replace_selectable Replace all occurrences of :class:`_expression.FromClause` 'old' with the given :class:`_expression.Alias` object, returning a copy of this :class:`_expression.FromClause`.
Class Variable is_selectable Undocumented

Inherited from ReturnsRows (via HasPrefixes, HasSuffixes, HasHints, HasCompileState, _SelectFromElements, GenerativeSelect, SelectBase, SelectStatementRole, TypedReturnsRows, ExecutableReturnsRows, Executable, StatementRole, DMLSelectRole, CompoundElementRole, AllowsLambdaRole, InElementRole, HasCTE, HasCTERole, SelectsRows, SupportsCloneAnnotations, Selectable):

Property selectable Undocumented
Class Variable _is_from_clause Undocumented
Class Variable _is_lateral Undocumented
Class Variable _is_returns_rows Undocumented

Inherited from SQLRole (via HasPrefixes, HasSuffixes, HasHints, HasCompileState, _SelectFromElements, GenerativeSelect, SelectBase, SelectStatementRole, TypedReturnsRows, ExecutableReturnsRows, Executable, StatementRole, DMLSelectRole, CompoundElementRole, AllowsLambdaRole, InElementRole, HasCTE, HasCTERole, SelectsRows, SupportsCloneAnnotations, Selectable, ReturnsRows, ReturnsRowsRole):

Class Variable uses_inspection Undocumented

Inherited from DQLDMLClauseElement (via HasPrefixes, HasSuffixes, HasHints, HasCompileState, _SelectFromElements, GenerativeSelect, SelectBase, SelectStatementRole, TypedReturnsRows, ExecutableReturnsRows, Executable, StatementRole, DMLSelectRole, CompoundElementRole, AllowsLambdaRole, InElementRole, HasCTE, HasCTERole, SelectsRows, SupportsCloneAnnotations, Selectable, ReturnsRows, ReturnsRowsRole, SQLRole):

Method compile Compile this SQL expression.
Method _compiler Return a compiler appropriate for this ClauseElement, given a Dialect.

Inherited from ClauseElement (via HasPrefixes, HasSuffixes, HasHints, HasCompileState, _SelectFromElements, GenerativeSelect, SelectBase, SelectStatementRole, TypedReturnsRows, ExecutableReturnsRows, Executable, StatementRole, DMLSelectRole, CompoundElementRole, AllowsLambdaRole, InElementRole, HasCTE, HasCTERole, SelectsRows, SupportsCloneAnnotations, Selectable, ReturnsRows, ReturnsRowsRole, SQLRole, DQLDMLClauseElement):

Method __bool__ Undocumented
Method __getstate__ Undocumented
Method __invert__ Undocumented
Method __repr__ Undocumented
Method compare Compare this :class:`_expression.ClauseElement` to the given :class:`_expression.ClauseElement`.
Method params Return a copy with :func:`_expression.bindparam` elements replaced.
Method unique_params Return a copy with :func:`_expression.bindparam` elements replaced.
Class Variable is_clause_element Undocumented
Class Variable negation_clause Undocumented
Property description Undocumented
Property entity_namespace Undocumented
Method _clone Create a shallow copy of this ClauseElement.
Method _cloned_set Return the set consisting all cloned ancestors of this ClauseElement.
Method _negate Undocumented
Method _negate_in_binary a hook to allow the right side of a binary expression to respond to a negation of the binary expression.
Method _replace_params Undocumented
Method _set_propagate_attrs Undocumented
Method _ungroup Return this :class:`_expression.ClauseElement` without any groupings.
Method _with_binary_element_type in the context of binary expression, convert the type of this object to the one given.
Class Variable _gen_static_annotations_cache_key Undocumented
Class Variable _is_bind_parameter Undocumented
Class Variable _is_clause_list Undocumented
Class Variable _is_clone_of Undocumented
Class Variable _is_column_element Undocumented
Class Variable _is_from_container Undocumented
Class Variable _is_immutable Undocumented
Class Variable _is_keyed_column_element Undocumented
Class Variable _is_lambda_element Undocumented
Class Variable _is_select_container Undocumented
Class Variable _is_singleton_constant Undocumented
Class Variable _is_star Undocumented
Class Variable _is_table Undocumented
Class Variable _is_text_clause Undocumented
Class Variable _is_textual Undocumented
Property _constructor return the 'constructor' for this ClauseElement.
Property _from_objects Undocumented
Property _order_by_label_element Undocumented

Inherited from SupportsAnnotations (via HasPrefixes, HasSuffixes, HasHints, HasCompileState, _SelectFromElements, GenerativeSelect, SelectBase, SelectStatementRole, TypedReturnsRows, ExecutableReturnsRows, Executable, StatementRole, DMLSelectRole, CompoundElementRole, AllowsLambdaRole, InElementRole, HasCTE, HasCTERole, SelectsRows, SupportsCloneAnnotations, Selectable, ReturnsRows, ReturnsRowsRole, SQLRole, DQLDMLClauseElement, ClauseElement, SupportsWrappingAnnotations):

Class Variable proxy_set Undocumented
Method _gen_annotations_cache_key Undocumented
Property _annotations_cache_key Undocumented

Inherited from MemoizedHasCacheKey (via HasPrefixes, HasSuffixes, HasHints, HasCompileState, _SelectFromElements, GenerativeSelect, SelectBase, SelectStatementRole, TypedReturnsRows, ExecutableReturnsRows, Executable, StatementRole, DMLSelectRole, CompoundElementRole, AllowsLambdaRole, InElementRole, HasCTE, HasCTERole, SelectsRows, SupportsCloneAnnotations, Selectable, ReturnsRows, ReturnsRowsRole, SQLRole, DQLDMLClauseElement, ClauseElement, SupportsWrappingAnnotations, SupportsAnnotations):

Method _generate_cache_key return a cache key.

Inherited from HasCacheKey (via HasPrefixes, HasSuffixes, HasHints, HasCompileState, _SelectFromElements, GenerativeSelect, SelectBase, SelectStatementRole, TypedReturnsRows, ExecutableReturnsRows, Executable, StatementRole, DMLSelectRole, CompoundElementRole, AllowsLambdaRole, InElementRole, HasCTE, HasCTERole, SelectsRows, SupportsCloneAnnotations, Selectable, ReturnsRows, ReturnsRowsRole, SQLRole, DQLDMLClauseElement, ClauseElement, SupportsWrappingAnnotations, SupportsAnnotations, MemoizedHasCacheKey):

Class Variable inherit_cache Indicate if this :class:`.HasCacheKey` instance should make use of the cache key generation scheme used by its immediate superclass.
Class Method _generate_cache_attrs generate cache key dispatcher for a new class.
Class Method _generate_cache_key_for_object Undocumented
Method _gen_cache_key return an optional cache key.
Class Variable _generated_cache_key_traversal Undocumented
Class Variable _hierarchy_supports_caching private attribute which may be set to False to prevent the inherit_cache warning from being emitted for a hierarchy of subclasses.
Class Variable _is_has_cache_key Undocumented

Inherited from Generative (via HasPrefixes, HasSuffixes, HasHints, HasCompileState, _SelectFromElements, GenerativeSelect, SelectBase, SelectStatementRole, TypedReturnsRows, ExecutableReturnsRows, Executable, StatementRole, DMLSelectRole, CompoundElementRole, AllowsLambdaRole, InElementRole, HasCTE, HasCTERole, SelectsRows, SupportsCloneAnnotations, Selectable, ReturnsRows, ReturnsRowsRole, SQLRole, DQLDMLClauseElement, ClauseElement, SupportsWrappingAnnotations, SupportsAnnotations, MemoizedHasCacheKey, HasCacheKey):

Method _generate Undocumented

Inherited from CompilerElement (via HasPrefixes, HasSuffixes, HasHints, HasCompileState, _SelectFromElements, GenerativeSelect, SelectBase, SelectStatementRole, TypedReturnsRows, ExecutableReturnsRows, Executable, StatementRole, DMLSelectRole, CompoundElementRole, AllowsLambdaRole, InElementRole, HasCTE, HasCTERole, SelectsRows, SupportsCloneAnnotations, Selectable, ReturnsRows, ReturnsRowsRole, SQLRole, DQLDMLClauseElement, ClauseElement, SupportsWrappingAnnotations, SupportsAnnotations, MemoizedHasCacheKey, HasCacheKey, Generative, HasCopyInternals, ExternallyTraversible, HasTraverseInternals):

Method __str__ Undocumented
Class Variable stringify_dialect Undocumented

Inherited from Visitable (via HasPrefixes, HasSuffixes, HasHints, HasCompileState, _SelectFromElements, GenerativeSelect, SelectBase, SelectStatementRole, TypedReturnsRows, ExecutableReturnsRows, Executable, StatementRole, DMLSelectRole, CompoundElementRole, AllowsLambdaRole, InElementRole, HasCTE, HasCTERole, SelectsRows, SupportsCloneAnnotations, Selectable, ReturnsRows, ReturnsRowsRole, SQLRole, DQLDMLClauseElement, ClauseElement, SupportsWrappingAnnotations, SupportsAnnotations, MemoizedHasCacheKey, HasCacheKey, Generative, HasCopyInternals, ExternallyTraversible, HasTraverseInternals, CompilerElement):

Method __class_getitem__ Undocumented
Method __init_subclass__ Undocumented
Class Method _generate_compiler_dispatch Undocumented
Method _compiler_dispatch Undocumented
Class Variable _original_compiler_dispatch Undocumented
def __init__(self, *entities: _ColumnsClauseArgument[Any]): (source)

Construct a new :class:`_expression.Select`. The public constructor for :class:`_expression.Select` is the :func:`_sql.select` function.

@_generative
def add_columns(self, *entities: _ColumnsClauseArgument[Any]) -> Select[Any]: (source)

Return a new :func:`_expression.select` construct with the given entities appended to its columns clause. E.g.:: my_select = my_select.add_columns(table.c.new_column) The original expressions in the columns clause remain in place. To replace the original expressions with new ones, see the method :meth:`_expression.Select.with_only_columns`. :param \*entities: column, table, or other entity expressions to be added to the columns clause .. seealso:: :meth:`_expression.Select.with_only_columns` - replaces existing expressions rather than appending. :ref:`orm_queryguide_select_multiple_entities` - ORM-centric example

@util.deprecated('1.4', 'The :meth:`_expression.Select.column` method is deprecated and will be removed in a future release. Please use :meth:`_expression.Select.add_columns`')
def column(self, column: _ColumnsClauseArgument[Any]) -> Select[Any]: (source)

Return a new :func:`_expression.select` construct with the given column expression added to its columns clause. E.g.:: my_select = my_select.column(table.c.new_column) See the documentation for :meth:`_expression.Select.with_only_columns` for guidelines on adding /replacing the columns of a :class:`_expression.Select` object.

@_generative
def correlate(self, *fromclauses: Union[Literal[None, False], _FromClauseArgument]) -> Self: (source)

Return a new :class:`_expression.Select` which will correlate the given FROM clauses to that of an enclosing :class:`_expression.Select`. Calling this method turns off the :class:`_expression.Select` object's default behavior of "auto-correlation". Normally, FROM elements which appear in a :class:`_expression.Select` that encloses this one via its :term:`WHERE clause`, ORDER BY, HAVING or :term:`columns clause` will be omitted from this :class:`_expression.Select` object's :term:`FROM clause`. Setting an explicit correlation collection using the :meth:`_expression.Select.correlate` method provides a fixed list of FROM objects that can potentially take place in this process. When :meth:`_expression.Select.correlate` is used to apply specific FROM clauses for correlation, the FROM elements become candidates for correlation regardless of how deeply nested this :class:`_expression.Select` object is, relative to an enclosing :class:`_expression.Select` which refers to the same FROM object. This is in contrast to the behavior of "auto-correlation" which only correlates to an immediate enclosing :class:`_expression.Select`. Multi-level correlation ensures that the link between enclosed and enclosing :class:`_expression.Select` is always via at least one WHERE/ORDER BY/HAVING/columns clause in order for correlation to take place. If ``None`` is passed, the :class:`_expression.Select` object will correlate none of its FROM entries, and all will render unconditionally in the local FROM clause. :param \*fromclauses: one or more :class:`.FromClause` or other FROM-compatible construct such as an ORM mapped entity to become part of the correlate collection; alternatively pass a single value ``None`` to remove all existing correlations. .. seealso:: :meth:`_expression.Select.correlate_except` :ref:`tutorial_scalar_subquery`

@_generative
def correlate_except(self, *fromclauses: Union[Literal[None, False], _FromClauseArgument]) -> Self: (source)

Return a new :class:`_expression.Select` which will omit the given FROM clauses from the auto-correlation process. Calling :meth:`_expression.Select.correlate_except` turns off the :class:`_expression.Select` object's default behavior of "auto-correlation" for the given FROM elements. An element specified here will unconditionally appear in the FROM list, while all other FROM elements remain subject to normal auto-correlation behaviors. If ``None`` is passed, or no arguments are passed, the :class:`_expression.Select` object will correlate all of its FROM entries. :param \*fromclauses: a list of one or more :class:`_expression.FromClause` constructs, or other compatible constructs (i.e. ORM-mapped classes) to become part of the correlate-exception collection. .. seealso:: :meth:`_expression.Select.correlate` :ref:`tutorial_scalar_subquery`

@_generative
def distinct(self, *expr: _ColumnExpressionArgument[Any]) -> Self: (source)

Return a new :func:`_expression.select` construct which will apply DISTINCT to its columns clause. :param \*expr: optional column expressions. When present, the PostgreSQL dialect will render a ``DISTINCT ON (<expressions>>)`` construct. .. deprecated:: 1.4 Using \*expr in other dialects is deprecated and will raise :class:`_exc.CompileError` in a future version.

Return a SQL ``EXCEPT`` of this select() construct against the given selectable provided as positional arguments. :param \*other: one or more elements with which to create a UNION. .. versionchanged:: 1.4.28 multiple elements are now accepted.

Return a SQL ``EXCEPT ALL`` of this select() construct against the given selectables provided as positional arguments. :param \*other: one or more elements with which to create a UNION. .. versionchanged:: 1.4.28 multiple elements are now accepted.

def filter(self, *criteria: _ColumnExpressionArgument[bool]) -> Self: (source)

A synonym for the :meth:`_sql.Select.where` method.

def filter_by(self, **kwargs: Any) -> Self: (source)

apply the given filtering criterion as a WHERE clause to this select.

def from_statement(self, statement: roles.ReturnsRowsRole) -> ExecutableReturnsRows: (source)

Apply the columns which this :class:`.Select` would select onto another statement. This operation is :term:`plugin-specific` and will raise a not supported exception if this :class:`_sql.Select` does not select from plugin-enabled entities. The statement is typically either a :func:`_expression.text` or :func:`_expression.select` construct, and should return the set of columns appropriate to the entities represented by this :class:`.Select`. .. seealso:: :ref:`orm_queryguide_selecting_text` - usage examples in the ORM Querying Guide

def get_children(self, **kw: Any) -> Iterable[ClauseElement]: (source)

Return immediate child :class:`.visitors.HasTraverseInternals` elements of this :class:`.visitors.HasTraverseInternals`. This is used for visit traversal. \**kw may contain flags that change the collection that is returned, for example to return a subset of items in order to cut down on larger traversals, or to return child items from a different context (such as schema-level collections instead of clause-level).

def get_final_froms(self) -> Sequence[FromClause]: (source)

Compute the final displayed list of :class:`_expression.FromClause` elements. This method will run through the full computation required to determine what FROM elements will be displayed in the resulting SELECT statement, including shadowing individual tables with JOIN objects, as well as full computation for ORM use cases including eager loading clauses. For ORM use, this accessor returns the **post compilation** list of FROM objects; this collection will include elements such as eagerly loaded tables and joins. The objects will **not** be ORM enabled and not work as a replacement for the :meth:`_sql.Select.select_froms` collection; additionally, the method is not well performing for an ORM enabled statement as it will incur the full ORM construction process. To retrieve the FROM list that's implied by the "columns" collection passed to the :class:`_sql.Select` originally, use the :attr:`_sql.Select.columns_clause_froms` accessor. To select from an alternative set of columns while maintaining the FROM list, use the :meth:`_sql.Select.with_only_columns` method and pass the :paramref:`_sql.Select.with_only_columns.maintain_column_froms` parameter. .. versionadded:: 1.4.23 - the :meth:`_sql.Select.get_final_froms` method replaces the previous :attr:`_sql.Select.froms` accessor, which is deprecated. .. seealso:: :attr:`_sql.Select.columns_clause_froms`

@_generative
def having(self, *having: _ColumnExpressionArgument[bool]) -> Self: (source)

Return a new :func:`_expression.select` construct with the given expression added to its HAVING clause, joined to the existing clause via AND, if any.

Return a SQL ``INTERSECT`` of this select() construct against the given selectables provided as positional arguments. :param \*other: one or more elements with which to create a UNION. .. versionchanged:: 1.4.28 multiple elements are now accepted. :param \**kwargs: keyword arguments are forwarded to the constructor for the newly created :class:`_sql.CompoundSelect` object.

Return a SQL ``INTERSECT ALL`` of this select() construct against the given selectables provided as positional arguments. :param \*other: one or more elements with which to create a UNION. .. versionchanged:: 1.4.28 multiple elements are now accepted. :param \**kwargs: keyword arguments are forwarded to the constructor for the newly created :class:`_sql.CompoundSelect` object.

def is_derived_from(self, fromclause: Optional[FromClause]) -> bool: (source)

Return ``True`` if this :class:`.ReturnsRows` is 'derived' from the given :class:`.FromClause`. An example would be an Alias of a Table is derived from that Table.

@_generative
def join(self, target: _JoinTargetArgument, onclause: Optional[_OnClauseArgument] = None, *, isouter: bool = False, full: bool = False) -> Self: (source)

Create a SQL JOIN against this :class:`_expression.Select` object's criterion and apply generatively, returning the newly resulting :class:`_expression.Select`. E.g.:: stmt = select(user_table).join(address_table, user_table.c.id == address_table.c.user_id) The above statement generates SQL similar to:: SELECT user.id, user.name FROM user JOIN address ON user.id = address.user_id .. versionchanged:: 1.4 :meth:`_expression.Select.join` now creates a :class:`_sql.Join` object between a :class:`_sql.FromClause` source that is within the FROM clause of the existing SELECT, and a given target :class:`_sql.FromClause`, and then adds this :class:`_sql.Join` to the FROM clause of the newly generated SELECT statement. This is completely reworked from the behavior in 1.3, which would instead create a subquery of the entire :class:`_expression.Select` and then join that subquery to the target. This is a **backwards incompatible change** as the previous behavior was mostly useless, producing an unnamed subquery rejected by most databases in any case. The new behavior is modeled after that of the very successful :meth:`_orm.Query.join` method in the ORM, in order to support the functionality of :class:`_orm.Query` being available by using a :class:`_sql.Select` object with an :class:`_orm.Session`. See the notes for this change at :ref:`change_select_join`. :param target: target table to join towards :param onclause: ON clause of the join. If omitted, an ON clause is generated automatically based on the :class:`_schema.ForeignKey` linkages between the two tables, if one can be unambiguously determined, otherwise an error is raised. :param isouter: if True, generate LEFT OUTER join. Same as :meth:`_expression.Select.outerjoin`. :param full: if True, generate FULL OUTER join. .. seealso:: :ref:`tutorial_select_join` - in the :doc:`/tutorial/index` :ref:`orm_queryguide_joins` - in the :ref:`queryguide_toplevel` :meth:`_expression.Select.join_from` :meth:`_expression.Select.outerjoin`

@_generative
def join_from(self, from_: _FromClauseArgument, target: _JoinTargetArgument, onclause: Optional[_OnClauseArgument] = None, *, isouter: bool = False, full: bool = False) -> Self: (source)

Create a SQL JOIN against this :class:`_expression.Select` object's criterion and apply generatively, returning the newly resulting :class:`_expression.Select`. E.g.:: stmt = select(user_table, address_table).join_from( user_table, address_table, user_table.c.id == address_table.c.user_id ) The above statement generates SQL similar to:: SELECT user.id, user.name, address.id, address.email, address.user_id FROM user JOIN address ON user.id = address.user_id .. versionadded:: 1.4 :param from\_: the left side of the join, will be rendered in the FROM clause and is roughly equivalent to using the :meth:`.Select.select_from` method. :param target: target table to join towards :param onclause: ON clause of the join. :param isouter: if True, generate LEFT OUTER join. Same as :meth:`_expression.Select.outerjoin`. :param full: if True, generate FULL OUTER join. .. seealso:: :ref:`tutorial_select_join` - in the :doc:`/tutorial/index` :ref:`orm_queryguide_joins` - in the :ref:`queryguide_toplevel` :meth:`_expression.Select.join`

def outerjoin(self, target: _JoinTargetArgument, onclause: Optional[_OnClauseArgument] = None, *, full: bool = False) -> Self: (source)

Create a left outer join. Parameters are the same as that of :meth:`_expression.Select.join`. .. versionchanged:: 1.4 :meth:`_expression.Select.outerjoin` now creates a :class:`_sql.Join` object between a :class:`_sql.FromClause` source that is within the FROM clause of the existing SELECT, and a given target :class:`_sql.FromClause`, and then adds this :class:`_sql.Join` to the FROM clause of the newly generated SELECT statement. This is completely reworked from the behavior in 1.3, which would instead create a subquery of the entire :class:`_expression.Select` and then join that subquery to the target. This is a **backwards incompatible change** as the previous behavior was mostly useless, producing an unnamed subquery rejected by most databases in any case. The new behavior is modeled after that of the very successful :meth:`_orm.Query.join` method in the ORM, in order to support the functionality of :class:`_orm.Query` being available by using a :class:`_sql.Select` object with an :class:`_orm.Session`. See the notes for this change at :ref:`change_select_join`. .. seealso:: :ref:`tutorial_select_join` - in the :doc:`/tutorial/index` :ref:`orm_queryguide_joins` - in the :ref:`queryguide_toplevel` :meth:`_expression.Select.join`

def outerjoin_from(self, from_: _FromClauseArgument, target: _JoinTargetArgument, onclause: Optional[_OnClauseArgument] = None, *, full: bool = False) -> Self: (source)

Create a SQL LEFT OUTER JOIN against this :class:`_expression.Select` object's criterion and apply generatively, returning the newly resulting :class:`_expression.Select`. Usage is the same as that of :meth:`_selectable.Select.join_from`.

@util.preload_module('sqlalchemy.sql.util')
def reduce_columns(self, only_synonyms: bool = True) -> Select[Any]: (source)

Return a new :func:`_expression.select` construct with redundantly named, equivalently-valued columns removed from the columns clause. "Redundant" here means two columns where one refers to the other either based on foreign key, or via a simple equality comparison in the WHERE clause of the statement. The primary purpose of this method is to automatically construct a select statement with all uniquely-named columns, without the need to use table-qualified labels as :meth:`_expression.Select.set_label_style` does. When columns are omitted based on foreign key, the referred-to column is the one that's kept. When columns are omitted based on WHERE equivalence, the first column in the columns clause is the one that's kept. :param only_synonyms: when True, limit the removal of columns to those which have the same name as the equivalent. Otherwise, all columns that are equivalent to another are removed.

@overload
def scalar_subquery(self: Select[Tuple[_MAYBE_ENTITY]]) -> ScalarSelect[Any]:
@overload
def scalar_subquery(self: Select[Tuple[_NOT_ENTITY]]) -> ScalarSelect[_NOT_ENTITY]:
@overload
def scalar_subquery(self) -> ScalarSelect[Any]:
(source)

Return a 'scalar' representation of this selectable, which can be used as a column expression. The returned object is an instance of :class:`_sql.ScalarSelect`. Typically, a select statement which has only one column in its columns clause is eligible to be used as a scalar expression. The scalar subquery can then be used in the WHERE clause or columns clause of an enclosing SELECT. Note that the scalar subquery differentiates from the FROM-level subquery that can be produced using the :meth:`_expression.SelectBase.subquery` method. .. versionchanged: 1.4 - the ``.as_scalar()`` method was renamed to :meth:`_expression.SelectBase.scalar_subquery`. .. seealso:: :ref:`tutorial_scalar_subquery` - in the 2.0 tutorial

@_generative
def select_from(self, *froms: _FromClauseArgument) -> Self: (source)

Return a new :func:`_expression.select` construct with the given FROM expression(s) merged into its list of FROM objects. E.g.:: table1 = table('t1', column('a')) table2 = table('t2', column('b')) s = select(table1.c.a).\ select_from( table1.join(table2, table1.c.a==table2.c.b) ) The "from" list is a unique set on the identity of each element, so adding an already present :class:`_schema.Table` or other selectable will have no effect. Passing a :class:`_expression.Join` that refers to an already present :class:`_schema.Table` or other selectable will have the effect of concealing the presence of that selectable as an individual element in the rendered FROM list, instead rendering it into a JOIN clause. While the typical purpose of :meth:`_expression.Select.select_from` is to replace the default, derived FROM clause with a join, it can also be called with individual table elements, multiple times if desired, in the case that the FROM clause cannot be fully derived from the columns clause:: select(func.count('*')).select_from(table1)

@HasMemoized_ro_memoized_attribute
def selected_columns(self) -> ColumnCollection[str, ColumnElement[Any]]: (source)

A :class:`_expression.ColumnCollection` representing the columns that this SELECT statement or similar construct returns in its result set, not including :class:`_sql.TextClause` constructs. This collection differs from the :attr:`_expression.FromClause.columns` collection of a :class:`_expression.FromClause` in that the columns within this collection cannot be directly nested inside another SELECT statement; a subquery must be applied first which provides for the necessary parenthesization required by SQL. For a :func:`_expression.select` construct, the collection here is exactly what would be rendered inside the "SELECT" statement, and the :class:`_expression.ColumnElement` objects are directly present as they were given, e.g.:: col1 = column('q', Integer) col2 = column('p', Integer) stmt = select(col1, col2) Above, ``stmt.selected_columns`` would be a collection that contains the ``col1`` and ``col2`` objects directly. For a statement that is against a :class:`_schema.Table` or other :class:`_expression.FromClause`, the collection will use the :class:`_expression.ColumnElement` objects that are in the :attr:`_expression.FromClause.c` collection of the from element. .. note:: The :attr:`_sql.Select.selected_columns` collection does not include expressions established in the columns clause using the :func:`_sql.text` construct; these are silently omitted from the collection. To use plain textual column expressions inside of a :class:`_sql.Select` construct, use the :func:`_sql.literal_column` construct. .. versionadded:: 1.4

def self_group(self, against: Optional[OperatorType] = None) -> Union[SelectStatementGrouping[Self], Self]: (source)

Apply a 'grouping' to this :class:`_expression.ClauseElement`. This method is overridden by subclasses to return a "grouping" construct, i.e. parenthesis. In particular it's used by "binary" expressions to provide a grouping around themselves when placed into a larger expression, as well as by :func:`_expression.select` constructs when placed into the FROM clause of another :func:`_expression.select`. (Note that subqueries should be normally created using the :meth:`_expression.Select.alias` method, as many platforms require nested SELECT statements to be named). As expressions are composed together, the application of :meth:`self_group` is automatic - end-user code should never need to use this method directly. Note that SQLAlchemy's clause constructs take operator precedence into account - so parenthesis might not be needed, for example, in an expression like ``x OR (y AND z)`` - AND takes precedence over OR. The base :meth:`self_group` method of :class:`_expression.ClauseElement` just returns self.

Return a SQL ``UNION`` of this select() construct against the given selectables provided as positional arguments. :param \*other: one or more elements with which to create a UNION. .. versionchanged:: 1.4.28 multiple elements are now accepted. :param \**kwargs: keyword arguments are forwarded to the constructor for the newly created :class:`_sql.CompoundSelect` object.

Return a SQL ``UNION ALL`` of this select() construct against the given selectables provided as positional arguments. :param \*other: one or more elements with which to create a UNION. .. versionchanged:: 1.4.28 multiple elements are now accepted. :param \**kwargs: keyword arguments are forwarded to the constructor for the newly created :class:`_sql.CompoundSelect` object.

@_generative
def where(self, *whereclause: _ColumnExpressionArgument[bool]) -> Self: (source)

Return a new :func:`_expression.select` construct with the given expression added to its WHERE clause, joined to the existing clause via AND, if any.

@overload
def with_only_columns(self, __ent0: _TCCA[_T0]) -> Select[Tuple[_T0]]:
@overload
def with_only_columns(self, __ent0: _TCCA[_T0], __ent1: _TCCA[_T1]) -> Select[Tuple[_T0, _T1]]:
@overload
def with_only_columns(self, __ent0: _TCCA[_T0], __ent1: _TCCA[_T1], __ent2: _TCCA[_T2]) -> Select[Tuple[_T0, _T1, _T2]]:
@overload
def with_only_columns(self, __ent0: _TCCA[_T0], __ent1: _TCCA[_T1], __ent2: _TCCA[_T2], __ent3: _TCCA[_T3]) -> Select[Tuple[_T0, _T1, _T2, _T3]]:
@overload
def with_only_columns(self, __ent0: _TCCA[_T0], __ent1: _TCCA[_T1], __ent2: _TCCA[_T2], __ent3: _TCCA[_T3], __ent4: _TCCA[_T4]) -> Select[Tuple[_T0, _T1, _T2, _T3, _T4]]:
@overload
def with_only_columns(self, __ent0: _TCCA[_T0], __ent1: _TCCA[_T1], __ent2: _TCCA[_T2], __ent3: _TCCA[_T3], __ent4: _TCCA[_T4], __ent5: _TCCA[_T5]) -> Select[Tuple[_T0, _T1, _T2, _T3, _T4, _T5]]:
@overload
def with_only_columns(self, __ent0: _TCCA[_T0], __ent1: _TCCA[_T1], __ent2: _TCCA[_T2], __ent3: _TCCA[_T3], __ent4: _TCCA[_T4], __ent5: _TCCA[_T5], __ent6: _TCCA[_T6]) -> Select[Tuple[_T0, _T1, _T2, _T3, _T4, _T5, _T6]]:
@overload
def with_only_columns(self, __ent0: _TCCA[_T0], __ent1: _TCCA[_T1], __ent2: _TCCA[_T2], __ent3: _TCCA[_T3], __ent4: _TCCA[_T4], __ent5: _TCCA[_T5], __ent6: _TCCA[_T6], __ent7: _TCCA[_T7]) -> Select[Tuple[_T0, _T1, _T2, _T3, _T4, _T5, _T6, _T7]]:
@overload
def with_only_columns(self, *entities: _ColumnsClauseArgument[Any], maintain_column_froms: bool = False, **__kw: Any) -> Select[Any]:
@_generative
(source)

Return a new :func:`_expression.select` construct with its columns clause replaced with the given entities. By default, this method is exactly equivalent to as if the original :func:`_expression.select` had been called with the given entities. E.g. a statement:: s = select(table1.c.a, table1.c.b) s = s.with_only_columns(table1.c.b) should be exactly equivalent to:: s = select(table1.c.b) In this mode of operation, :meth:`_sql.Select.with_only_columns` will also dynamically alter the FROM clause of the statement if it is not explicitly stated. To maintain the existing set of FROMs including those implied by the current columns clause, add the :paramref:`_sql.Select.with_only_columns.maintain_column_froms` parameter:: s = select(table1.c.a, table2.c.b) s = s.with_only_columns(table1.c.a, maintain_column_froms=True) The above parameter performs a transfer of the effective FROMs in the columns collection to the :meth:`_sql.Select.select_from` method, as though the following were invoked:: s = select(table1.c.a, table2.c.b) s = s.select_from(table1, table2).with_only_columns(table1.c.a) The :paramref:`_sql.Select.with_only_columns.maintain_column_froms` parameter makes use of the :attr:`_sql.Select.columns_clause_froms` collection and performs an operation equivalent to the following:: s = select(table1.c.a, table2.c.b) s = s.select_from(*s.columns_clause_froms).with_only_columns(table1.c.a) :param \*entities: column expressions to be used. :param maintain_column_froms: boolean parameter that will ensure the FROM list implied from the current columns clause will be transferred to the :meth:`_sql.Select.select_from` method first. .. versionadded:: 1.4.23

@property
column_descriptions: Any = (source)

Return a :term:`plugin-enabled` 'column descriptions' structure referring to the columns which are SELECTed by this statement. This attribute is generally useful when using the ORM, as an extended structure which includes information about mapped entities is returned. The section :ref:`queryguide_inspection` contains more background. For a Core-only statement, the structure returned by this accessor is derived from the same objects that are returned by the :attr:`.Select.selected_columns` accessor, formatted as a list of dictionaries which contain the keys ``name``, ``type`` and ``expr``, which indicate the column expressions to be selected:: >>> stmt = select(user_table) >>> stmt.column_descriptions [ { 'name': 'id', 'type': Integer(), 'expr': Column('id', Integer(), ...)}, { 'name': 'name', 'type': String(length=30), 'expr': Column('name', String(length=30), ...)} ] .. versionchanged:: 1.4.33 The :attr:`.Select.column_descriptions` attribute returns a structure for a Core-only set of entities, not just ORM-only entities. .. seealso:: :attr:`.UpdateBase.entity_description` - entity information for an :func:`.insert`, :func:`.update`, or :func:`.delete` :ref:`queryguide_inspection` - ORM background

@property
columns_clause_froms: List[FromClause] = (source)

Return the set of :class:`_expression.FromClause` objects implied by the columns clause of this SELECT statement. .. versionadded:: 1.4.23 .. seealso:: :attr:`_sql.Select.froms` - "final" FROM list taking the full statement into account :meth:`_sql.Select.with_only_columns` - makes use of this collection to set up a new FROM list

@property
@util.deprecated('1.4.23', 'The :attr:`_expression.Select.froms` attribute is moved to the :meth:`_expression.Select.get_final_froms` method.')
froms: Sequence[FromClause] = (source)

Return the displayed list of :class:`_expression.FromClause` elements.

An iterator of all :class:`_expression.ColumnElement` expressions which would be rendered into the columns clause of the resulting SELECT statement. This method is legacy as of 1.4 and is superseded by the :attr:`_expression.Select.exported_columns` collection.

Return the completed WHERE clause for this :class:`_expression.Select` statement. This assembles the current collection of WHERE criteria into a single :class:`_expression.BooleanClauseList` construct. .. versionadded:: 1.4

@classmethod
def _create_raw_select(cls, **kw: Any) -> Select[Any]: (source)

Create a :class:`.Select` using raw ``__new__`` with no coercions. Used internally to build up :class:`.Select` constructs with pre-established state.

@HasMemoized_ro_memoized_attribute
def _all_selected_columns(self) -> _SelectIterable: (source)

A sequence of expressions that correspond to what is rendered in the columns clause, including :class:`_sql.TextClause` constructs. .. versionadded:: 1.4.12 .. seealso:: :attr:`_sql.SelectBase.exported_columns`

def _copy_internals(self, clone: _CloneCallableType = _clone, **kw: Any): (source)

Reassign internal elements to be clones of themselves. Called during a copy-and-traverse operation on newly shallow-copied elements to create a deep copy. The given clone function should be used, which may be applying additional transformations to the element (i.e. replacement traversal, cloned traversal, annotations).

def _ensure_disambiguated_names(self) -> Select[Any]: (source)

Ensure that the names generated by this selectbase will be disambiguated in some way, if possible.

Undocumented

def _generate_fromclause_column_proxies(self, subquery: FromClause, *, proxy_compound_columns: Optional[Iterable[Sequence[ColumnElement[Any]]]] = None): (source)

Generate column proxies to place in the exported ``.c`` collection of a subquery.

def _needs_parens_for_grouping(self) -> bool: (source)

Undocumented

def _set_entities(self, entities: Iterable[_ColumnsClauseArgument[Any]]): (source)

Undocumented

_compile_state_factory: Type[SelectState] = (source)

Undocumented

_having_criteria: Tuple[ColumnElement[Any], ...] = (source)

Undocumented

_memoized_select_entities: Tuple[TODO_Any, ...] = (source)

Undocumented

Undocumented

_auto_correlate: bool = (source)

Undocumented

_correlate: tuple = (source)

Undocumented

_correlate_except: tuple = (source)

Undocumented

_distinct: bool = (source)

Undocumented

_distinct_on = (source)

Undocumented