The snippet library.
Small, practical examples. Search by task or narrow things down below.
Combine text values with a separator
SQLite: Use the concatenation operator supported by the selected SQL dialect.
SQLite✓ Tested
Match a known text prefix
SQLite: A percent wildcard matches zero or more characters following the prefix.
SQLite✓ Tested
Measure the length of ordinary text
SQLite: Use the engine’s text-length function; this ASCII example has no trailing spaces.
SQLite✓ Tested
Normalize ASCII text to lowercase
SQLite: LOWER is useful for display normalization; indexed case-insensitive search depends on the database collation and schema.
SQLite✓ Tested
Normalize ASCII text to uppercase
SQLite: UPPER changes character case under the database’s text rules.
SQLite✓ Tested
Place missing values after known values portably
SQLite: A CASE sort key controls NULL placement without relying on engine-specific defaults.
SQLite✓ Tested
Remove surrounding spaces from text
SQLite: TRIM removes leading and trailing space characters by default.
SQLite✓ Tested
Replace a literal substring
SQLite: REPLACE performs a literal replacement rather than a regular-expression substitution.
SQLite✓ Tested
Search for a literal LIKE wildcard
SQLite: Declare an escape character so a percent sign in the pattern is literal.
SQLite✓ Tested
Treat an empty trimmed value as missing
SQLite: NULLIF converts an empty string to NULL before a fallback is applied.
SQLite✓ Tested