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)
| 2219 | ) |
| 2220 | |
| 2221 | def alias(self, name: Optional[str] = None, flat: bool = False) -> CTE: |
| 2222 | """Return an :class:`_expression.Alias` of this |
| 2223 | :class:`_expression.CTE`. |
| 2224 | |
| 2225 | This method is a CTE-specific specialization of the |
| 2226 | :meth:`_expression.FromClause.alias` method. |
| 2227 | |
| 2228 | .. seealso:: |
| 2229 | |
| 2230 | :ref:`tutorial_using_aliases` |
| 2231 | |
| 2232 | :func:`_expression.alias` |
| 2233 | |
| 2234 | """ |
| 2235 | return CTE._construct( |
| 2236 | self.element, |
| 2237 | name=name, |
| 2238 | recursive=self.recursive, |
| 2239 | nesting=self.nesting, |
| 2240 | _cte_alias=self, |
| 2241 | _prefixes=self._prefixes, |
| 2242 | _suffixes=self._suffixes, |
| 2243 | ) |
| 2244 | |
| 2245 | def union(self, *other: _SelectStatementForCompoundArgument[Any]) -> CTE: |
| 2246 | r"""Return a new :class:`_expression.CTE` with a SQL ``UNION`` |