databases/sql/functions
Prev: clauses | Up: sql | Next: design_patterns
Rel: Aggregations, CTEs & Window Functions, sqlite3, postgresql
Ref: PostgreSQL — The SQL Language
Tags: #public #databases #sql #functions #index
Overview
Standard SQL aggregate, scalar, null-handling, and analytic window functions.
Core (#tier/core)
- `COUNT` — Counts rows (
COUNT(*)) or non-null values (COUNT(col)). - `SUM` — Computes sum (or average/min/max) across non-null values in a group.
- `COALESCE` — Returns the first non-
NULLargument from left to right (short-circuiting). - `CASE` — Inline conditional expression evaluated top-to-bottom.
- `CAST` — Explicitly converts an expression to a target SQL data type.
- `ROW NUMBER` — Assigns a unique sequential integer (
1, 2, 3...) per partition. - `LAG` — Accesses the previous (
LAG) or next (LEAD) row's value without a self-join. - `CURRENT TIMESTAMP` — Returns current UTC timestamp (SQLite) or transaction-start
TIMESTAMPTZ(PostgreSQL).
Standard (#tier/standard)
Linked from
- tuts/databases/sql
- tuts/databases/sql/clauses
- tuts/databases/sql/clauses/EXPLAIN
- tuts/databases/sql/functions/CASE
- tuts/databases/sql/functions/CAST
- tuts/databases/sql/functions/COALESCE
- tuts/databases/sql/functions/COUNT
- tuts/databases/sql/functions/CURRENT_TIMESTAMP
- tuts/databases/sql/functions/LAG
- tuts/databases/sql/functions/LOWER
- tuts/databases/sql/functions/NULLIF
- tuts/databases/sql/functions/RANK
- tuts/databases/sql/functions/ROW_NUMBER
- tuts/databases/sql/functions/SUM
Related notes
- tuts/databases/sql Linked here; links to this page; shared tags: #databases, #index, #sql
- tuts/databases/sql/clauses Linked here; links to this page; shared tags: #databases, #index, #sql
- tuts/databases/sql/functions/CASE Linked here; links to this page; shared tags: #databases, #functions, #sql
- tuts/databases/sql/functions/CAST Linked here; links to this page; shared tags: #databases, #functions, #sql
- tuts/databases/sql/functions/COALESCE Linked here; links to this page; shared tags: #databases, #functions, #sql
- tuts/databases/sql/functions/COUNT Linked here; links to this page; shared tags: #databases, #functions, #sql
- tuts/databases/sql/functions/CURRENT_TIMESTAMP Linked here; links to this page; shared tags: #databases, #functions, #sql
- tuts/databases/sql/functions/LAG Linked here; links to this page; shared tags: #databases, #functions, #sql
- tuts/databases/sql/functions/LOWER Linked here; links to this page; shared tags: #databases, #functions, #sql
- tuts/databases/sql/functions/NULLIF Linked here; links to this page; shared tags: #databases, #functions, #sql