Results for “when”
Small, practical examples. Search by task or narrow things down below.
Enumerate hashtable entries in a stable order
PowerShell: Sort entries by key when predictable output matters.
PowerShell✓ Tested
Enumerate matching files recursively
C#: Sort relative filenames when reproducible traversal output is required.
C#✓ Tested
Extract a filename from a path
Linux Commands: Use basename with an explicit suffix when removing a known extension.
Linux Commands✓ Tested
Extract the text after the last delimiter
JavaScript: Use lastIndexOf when earlier occurrences should remain part of the prefix.
JavaScript✓ Tested
Extract the text after the last delimiter
TypeScript: Use lastIndexOf when earlier occurrences should remain part of the prefix.
TypeScript✓ Tested
Filter aggregate groups
Keep only categories with multiple products.
HAVING✓ Tested
Filter rows with WHERE
Keep products below a chosen price.
WHERE✓ Tested
Find parents with at least two child rows
SQL: Use a correlated count when testing a per-parent threshold.
SQL✓ Tested
Find parents with at least two child rows
SQL Server: Use a correlated count when testing a per-parent threshold.
SQL Server✓ Tested
Find parents with at least two child rows
Postgres: Use a correlated count when testing a per-parent threshold.
Postgres✓ Tested
Find parents with at least two child rows
SQLite: Use a correlated count when testing a per-parent threshold.
SQLite✓ Tested
Find records without any related rows
SQL: NOT EXISTS avoids the NULL pitfalls of NOT IN when the subquery column can be missing.
SQL✓ Tested