From the course: Advanced SQL: Logical Query Processing, Part 2

Unlock the full course today

Join today to access over 22,700 courses taught by industry experts or purchase this course individually.

Ordered set functions

Ordered set functions - SQL Tutorial

From the course: Advanced SQL: Logical Query Processing, Part 2

Start my 1-month free trial

Ordered set functions

- [Instructor] Most aggregate functions don't rely on any order. MIN, MAX, COUNT, and SUM are inherently order-agnostic. The result will be the same regardless of any order of the individual elements. Ordered set functions are aggregate functions but ones that are effected by element order. They are processed like any other aggregate function except for the order significance. This is the general syntax for ordered set functions. The ANSI SQL standard defines two types of ordered set functions, hypothetical set functions, and inverse distribution functions. If you watched my window functions course, the hypothetical set functions should look familiar and it's no coincidence. We'll get back to these shortly. Most databases support additional proprietary ordered set functions. And one of the most familiar and loved are the string aggregation functions that can concatenate individual string values within a group into a…

Contents