Results for “Text validation & formatting”
Small, practical examples. Search by task or narrow things down below.
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
Roll back a trial update
Group a change in a transaction and undo it.
transaction✓ Tested
Round a decimal with an explicit rule
Java: Construct BigDecimal from text to avoid importing a binary floating-point approximation.
Java✓ Tested
Round a timestamp down to its month
Group dates by a calendar boundary.
date_trunc✓ Tested
Run a first SELECT query
SQL: Return a literal value without creating a table.
SQL✓ Tested
Run a first SELECT query
SQL Server: Return a literal value without creating a table.
SQL Server✓ Tested
Run a first SELECT query
Postgres: Return a literal value without creating a table.
Postgres✓ Tested
Run a first SELECT query
SQLite: Return a literal value without creating a table.
SQLite✓ Tested
Select an inclusive range
Find rows with values between two endpoints.
BETWEEN✓ Tested