Return an :class:`_expression.Alias` of this :class:`_expression.CTE`. This method is a CTE-specific specialization of the :meth:`_expression.FromClause.alias` method. .. seealso:: :ref:`tutorial_using_aliases` :func:`_expression.alias`
(
self, name: Optional[str] = None, flat: bool = False
)
| 2271 | ) |
| 2272 | |
| 2273 | def alias( |
| 2274 | self, name: Optional[str] = None, flat: bool = False |
| 2275 | ) -> CTE[_KeyColCC_co]: |
| 2276 | """Return an :class:`_expression.Alias` of this |
| 2277 | :class:`_expression.CTE`. |
| 2278 | |
| 2279 | This method is a CTE-specific specialization of the |
| 2280 | :meth:`_expression.FromClause.alias` method. |
| 2281 | |
| 2282 | .. seealso:: |
| 2283 | |
| 2284 | :ref:`tutorial_using_aliases` |
| 2285 | |
| 2286 | :func:`_expression.alias` |
| 2287 | |
| 2288 | """ |
| 2289 | return CTE._construct( |
| 2290 | self.element, |
| 2291 | name=name, |
| 2292 | recursive=self.recursive, |
| 2293 | nesting=self.nesting, |
| 2294 | _cte_alias=self, |
| 2295 | _prefixes=self._prefixes, |
| 2296 | _suffixes=self._suffixes, |
| 2297 | ) |
| 2298 | |
| 2299 | def union( |
| 2300 | self, *other: _SelectStatementForCompoundArgument[Any] |