Results for “Context & shared state”
Small, practical examples. Search by task or narrow things down below.
Require a value with NOT NULL
SQL: Declare required fields at the database boundary, not only in application validation.
SQL✓ Tested
Require a value with NOT NULL
SQL Server: Declare required fields at the database boundary, not only in application validation.
SQL Server✓ Tested
Require a value with NOT NULL
Postgres: Declare required fields at the database boundary, not only in application validation.
Postgres✓ Tested
Require a value with NOT NULL
SQLite: Declare required fields at the database boundary, not only in application validation.
SQLite✓ Tested
Return all rows tied for the maximum in a group
SQL: An equality comparison with a grouped maximum retains ties rather than choosing one arbitrary row.
SQL✓ Tested
Return all rows tied for the maximum in a group
SQL Server: An equality comparison with a grouped maximum retains ties rather than choosing one arbitrary row.
SQL Server✓ Tested
Return all rows tied for the maximum in a group
Postgres: An equality comparison with a grouped maximum retains ties rather than choosing one arbitrary row.
Postgres✓ Tested
Return all rows tied for the maximum in a group
SQLite: An equality comparison with a grouped maximum retains ties rather than choosing one arbitrary row.
SQLite✓ Tested
Return text from a shell function
Capture a function’s output with command substitution.
function✓ Tested
Return zero for a sum over no rows
SQL: SUM produces NULL for an empty input; COALESCE supplies the desired reporting default.
SQL✓ Tested
Return zero for a sum over no rows
SQL Server: SUM produces NULL for an empty input; COALESCE supplies the desired reporting default.
SQL Server✓ Tested
Return zero for a sum over no rows
Postgres: SUM produces NULL for an empty input; COALESCE supplies the desired reporting default.
Postgres✓ Tested