Results for “Arrays & embedded state”
Small, practical examples. Search by task or narrow things down below.
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
Return zero for a sum over no rows
SQLite: SUM produces NULL for an empty input; COALESCE supplies the desired reporting default.
SQLite✓ Tested
Reuse colors with custom properties
Define a CSS custom property and use it for text color.
CSS✓ Tested
Reverse an array in place
Swap C array elements from opposite ends.
C✓ Tested
Run cleanup after an AJAX failure
jQuery: always runs on success or failure and can clear loading state.
jQuery✓ Tested
Scale text within limits
Use CSS clamp to bound responsive font sizing.
CSS✓ Tested
Scroll wide code locally
Keep long code inside a horizontally scrollable CSS container.
CSS✓ Tested
Search for a literal LIKE wildcard
SQL: Declare an escape character so a percent sign in the pattern is literal.
SQL✓ Tested
Search for a literal LIKE wildcard
SQL Server: Declare an escape character so a percent sign in the pattern is literal.
SQL Server✓ Tested
Search for a literal LIKE wildcard
Postgres: Declare an escape character so a percent sign in the pattern is literal.
Postgres✓ Tested