Represent a WITHIN GROUP (ORDER BY) clause. This is a special operator against so-called "ordered set aggregate" and "hypothetical set aggregate" functions, including ``percentile_cont()``, ``rank()``, ``dense_rank()``, etc. It's supported only by certain database backends, suc
| 4867 | |
| 4868 | |
| 4869 | class WithinGroup(AggregateOrderBy[_T]): |
| 4870 | """Represent a WITHIN GROUP (ORDER BY) clause. |
| 4871 | |
| 4872 | This is a special operator against so-called |
| 4873 | "ordered set aggregate" and "hypothetical |
| 4874 | set aggregate" functions, including ``percentile_cont()``, |
| 4875 | ``rank()``, ``dense_rank()``, etc. |
| 4876 | |
| 4877 | It's supported only by certain database backends, such as PostgreSQL, |
| 4878 | Oracle Database and MS SQL Server. |
| 4879 | |
| 4880 | The :class:`.WithinGroup` construct extracts its type from the |
| 4881 | method :meth:`.FunctionElement.within_group_type`. If this returns |
| 4882 | ``None``, the function's ``.type`` is used. |
| 4883 | |
| 4884 | """ |
| 4885 | |
| 4886 | __visit_name__ = "withingroup" |
| 4887 | inherit_cache = True |
| 4888 | |
| 4889 | if not TYPE_CHECKING: |
| 4890 | |
| 4891 | @util.memoized_property |
| 4892 | def type(self) -> TypeEngine[_T]: # noqa: A001 |
| 4893 | wgt = self.element.within_group_type(self) |
| 4894 | if wgt is not None: |
| 4895 | return wgt |
| 4896 | else: |
| 4897 | return self.element.type |
| 4898 | |
| 4899 | |
| 4900 | class FunctionFilter(Generative, ColumnElement[_T]): |
no outgoing calls
no test coverage detected