Results for “form”
Small, practical examples. Search by task or narrow things down below.
Generate every combination of two sets
SQLite: CROSS JOIN creates one result per possible pair, so the output size is the product of the input sizes.
SQLite✓ Tested
Generate numbers with a recursive CTE
Build a bounded sequence using SQL recursion.
recursive CTE✓ Tested
Get the latest row in each group
Select one ordered row per key with DISTINCT ON.
DISTINCT ON✓ Tested
Give a result column a readable name
SQL: Use AS to label a computed result column.
SQL✓ Tested
Give a result column a readable name
SQL Server: Use AS to label a computed result column.
SQL Server✓ Tested
Give a result column a readable name
Postgres: Use AS to label a computed result column.
Postgres✓ Tested
Give a result column a readable name
SQLite: Use AS to label a computed result column.
SQLite✓ Tested
Group by more than one field
SQL: Each distinct combination of grouping fields produces its own row.
SQL✓ Tested
Group by more than one field
SQL Server: Each distinct combination of grouping fields produces its own row.
SQL Server✓ Tested
Group by more than one field
Postgres: Each distinct combination of grouping fields produces its own row.
Postgres✓ Tested
Group by more than one field
SQLite: Each distinct combination of grouping fields produces its own row.
SQLite✓ Tested
Group mutually exclusive choices
Use the same name for HTML radio buttons and a fieldset legend.
HTML✓ Tested