Skip to content

Commit c7519e9

Browse files
committed
sub-categorize special function forms
this is the tutorial, which should have some semblence of not getting too far into the weeds. however, as we dont really have other places to explain SQL concepts, and SQL functions have a lot of them, we dont have another home right now. so at least further sub-categorize window functions, table/column valued functions, and WITHIN GROUP into an "advanced function techniques" section with a disclaimer that these are less common use cases. Change-Id: I4b16bd5673c0bd39a9b880338f6ce3cfbafbe271
1 parent c984d77 commit c7519e9

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

doc/build/tutorial/data_select.rst

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1534,10 +1534,19 @@ Overall, the scenario where the
15341534
or again special datatypes such as :class:`_types.JSON`,
15351535
:class:`_types.ARRAY`.
15361536

1537+
Advanced SQL Function Techniques
1538+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1539+
1540+
The following subsections illustrate more things that can be done with
1541+
SQL functions. While these techniques are less common and more advanced than
1542+
basic SQL function use, they nonetheless are extremely popular, largely
1543+
as a result of PostgreSQL's emphasis on more complex function forms, including
1544+
table- and column-valued forms that are popular with JSON data.
1545+
15371546
.. _tutorial_window_functions:
15381547

15391548
Using Window Functions
1540-
~~~~~~~~~~~~~~~~~~~~~~
1549+
######################
15411550

15421551
A window function is a special use of a SQL aggregate function which calculates
15431552
the aggregate value over the rows being returned in a group as the individual
@@ -1613,7 +1622,7 @@ Further options for window functions include usage of ranges; see
16131622
.. _tutorial_functions_within_group:
16141623

16151624
Special Modifiers WITHIN GROUP, FILTER
1616-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1625+
######################################
16171626

16181627
The "WITHIN GROUP" SQL syntax is used in conjunction with an "ordered set"
16191628
or a "hypothetical set" aggregate
@@ -1653,7 +1662,7 @@ using the :meth:`_functions.FunctionElement.filter` method::
16531662
.. _tutorial_functions_table_valued:
16541663

16551664
Table-Valued Functions
1656-
~~~~~~~~~~~~~~~~~~~~~~~~~
1665+
#######################
16571666

16581667
Table-valued SQL functions support a scalar representation that contains named
16591668
sub-elements. Often used for JSON and ARRAY-oriented functions as well as
@@ -1708,7 +1717,7 @@ towards as ``value``, and then selected two of its three rows.
17081717
.. _tutorial_functions_column_valued:
17091718

17101719
Column Valued Functions - Table Valued Function as a Scalar Column
1711-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1720+
##################################################################
17121721

17131722
A special syntax supported by PostgreSQL and Oracle is that of referring
17141723
towards a function in the FROM clause, which then delivers itself as a

0 commit comments

Comments
 (0)