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
| 5283 | |
| 5284 | |
| 5285 | class Select( |
| 5286 | HasPrefixes, |
| 5287 | HasSuffixes, |
| 5288 | HasHints, |
| 5289 | HasCompileState, |
| 5290 | _SelectFromElements, |
| 5291 | GenerativeSelect, |
| 5292 | TypedReturnsRows[_TP], |
| 5293 | ): |
| 5294 | """Represents a ``SELECT`` statement. |
| 5295 | |
| 5296 | The :class:`_sql.Select` object is normally constructed using the |
| 5297 | :func:`_sql.select` function. See that function for details. |
| 5298 | |
| 5299 | .. seealso:: |
| 5300 | |
| 5301 | :func:`_sql.select` |
| 5302 | |
| 5303 | :ref:`tutorial_selecting_data` - in the 2.0 tutorial |
| 5304 | |
| 5305 | """ |
| 5306 | |
| 5307 | __visit_name__ = "select" |
| 5308 | |
| 5309 | _setup_joins: Tuple[_SetupJoinsElement, ...] = () |
| 5310 | _memoized_select_entities: Tuple[TODO_Any, ...] = () |
| 5311 | |
| 5312 | _raw_columns: List[_ColumnsClauseElement] |
| 5313 | |
| 5314 | _distinct: bool = False |
| 5315 | _distinct_on: Tuple[ColumnElement[Any], ...] = () |
| 5316 | _correlate: Tuple[FromClause, ...] = () |
| 5317 | _correlate_except: Optional[Tuple[FromClause, ...]] = None |
| 5318 | _where_criteria: Tuple[ColumnElement[Any], ...] = () |
| 5319 | _having_criteria: Tuple[ColumnElement[Any], ...] = () |
| 5320 | _from_obj: Tuple[FromClause, ...] = () |
| 5321 | _auto_correlate = True |
| 5322 | _is_select_statement = True |
| 5323 | _compile_options: CacheableOptions = ( |
| 5324 | SelectState.default_select_compile_options |
| 5325 | ) |
| 5326 | |
| 5327 | _traverse_internals: _TraverseInternalsType = ( |
| 5328 | [ |
| 5329 | ("_raw_columns", InternalTraversal.dp_clauseelement_list), |
| 5330 | ( |
| 5331 | "_memoized_select_entities", |
| 5332 | InternalTraversal.dp_memoized_select_entities, |
| 5333 | ), |
| 5334 | ("_from_obj", InternalTraversal.dp_clauseelement_list), |
| 5335 | ("_where_criteria", InternalTraversal.dp_clauseelement_tuple), |
| 5336 | ("_having_criteria", InternalTraversal.dp_clauseelement_tuple), |
| 5337 | ("_order_by_clauses", InternalTraversal.dp_clauseelement_tuple), |
| 5338 | ("_group_by_clauses", InternalTraversal.dp_clauseelement_tuple), |
| 5339 | ("_setup_joins", InternalTraversal.dp_setup_join_tuple), |
| 5340 | ("_correlate", InternalTraversal.dp_clauseelement_tuple), |
| 5341 | ("_correlate_except", InternalTraversal.dp_clauseelement_tuple), |
| 5342 | ("_limit_clause", InternalTraversal.dp_clauseelement), |