Results for “post”
Small, practical examples. Search by task or narrow things down below.
Remove duplicate result values
SQL: Use DISTINCT when repeated category values are not useful.
SQL✓ Tested
Remove duplicate values while keeping the smallest key
SQL: Identify retained keys in a grouped subquery before deleting other copies.
SQL✓ Tested
Remove surrounding spaces from text
SQL: TRIM removes leading and trailing space characters by default.
SQL✓ Tested
Repeat the first ordered value beside each row
SQL: FIRST_VALUE reads the first value in the current window frame.
SQL✓ Tested
Replace a literal substring
SQL: REPLACE performs a literal replacement rather than a regular-expression substitution.
SQL✓ Tested
Replace a nested JSONB value
Change one path with jsonb_set.
jsonb_set✓ Tested
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
SQL: Group by a candidate business key and retain only groups with multiple rows.
SQL✓ Tested
Require a value with NOT NULL
SQL: Declare required fields at the database boundary, not only in application validation.
SQL✓ Tested
Require two filtering conditions
SQL: Combine category and quantity conditions with AND.
SQL✓ 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