Results for “SQL Server”
Small, practical examples. Search by task or narrow things down below.
Replace all matching text
Normalize repeated whitespace with a regular expression.
regexp_replace✓ Tested
Replace NULL in a result
Choose a fallback for a missing value.
COALESCE✓ Tested
Report duplicate business values and their frequency
Postgres: Group by a candidate business key and retain only groups with multiple rows.
Postgres✓ Tested
Require a value with NOT NULL
Postgres: Declare required fields at the database boundary, not only in application validation.
Postgres✓ Tested
Require two filtering conditions
Postgres: Combine category and quantity conditions with AND.
Postgres✓ 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 an inserted row
Read generated data directly from INSERT.
RETURNING✓ 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
Round a timestamp down to its month
Group dates by a calendar boundary.
date_trunc✓ Tested
Run a first SELECT query
Postgres: Return a literal value without creating a table.
Postgres✓ Tested
Search a small FTS5 table
Use SQLite’s full-text index to match a term.
FTS5✓ Tested
Search for a literal LIKE wildcard
Postgres: Declare an escape character so a percent sign in the pattern is literal.
Postgres✓ Tested