Results for “ps”
Small, practical examples. Search by task or narrow things down below.
Report duplicate business values and their frequency
Postgres: Group by a candidate business key and retain only groups with multiple rows.
Postgres✓ Tested
Report duplicate business values and their frequency
SQLite: Group by a candidate business key and retain only groups with multiple rows.
SQLite✓ 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
Restore an environment value after temporary use
PowerShell: Use finally so temporary process configuration does not leak to subsequent work; remove the entry when it was originally absent.
PowerShell✓ Tested
Restore the working location after an operation
PowerShell: Push-Location and Pop-Location manage a directory stack; finally ensures restoration.
PowerShell✓ Tested
Restrict a function parameter to known choices
PowerShell: ValidateSet rejects unsupported values before the function body executes.
PowerShell✓ Tested
Return a collection as one pipeline object
PowerShell: The unary comma prevents the returned array from being enumerated at this boundary.
PowerShell✓ 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
Reverse a copy while preserving the source
PowerShell: Clone the array before using Array.Reverse because Reverse mutates its argument.
PowerShell✓ Tested