Results for “when”
Small, practical examples. Search by task or narrow things down below.
Find records without any related rows
SQL Server: NOT EXISTS avoids the NULL pitfalls of NOT IN when the subquery column can be missing.
SQL Server✓ Tested
Find records without any related rows
Postgres: NOT EXISTS avoids the NULL pitfalls of NOT IN when the subquery column can be missing.
Postgres✓ Tested
Find records without any related rows
SQLite: NOT EXISTS avoids the NULL pitfalls of NOT IN when the subquery column can be missing.
SQLite✓ Tested
Find rows with a related record
Use EXISTS without duplicating the outer rows.
EXISTS✓ Tested
Find shared set members
Java: Copy a set before retainAll when the original must remain unchanged.
Java✓ Tested
Find the first day of a month
Round a date to its calendar month boundary.
date✓ Tested
Find the first matching array item
JavaScript: find returns undefined when no item satisfies the predicate.
JavaScript✓ Tested
Find the first matching array item
TypeScript: find returns undefined when no item satisfies the predicate.
TypeScript✓ Tested
Find the index of an array item
PowerShell: Array.IndexOf returns -1 when the requested item is absent.
PowerShell✓ Tested
Find the position of a matching item
JavaScript: findIndex returns -1 when the predicate matches nothing.
JavaScript✓ Tested
Find the position of a matching item
TypeScript: findIndex returns -1 when the predicate matches nothing.
TypeScript✓ Tested
Find values present in exactly one set
Python: Use symmetric difference when either side can contain unmatched values.
Python✓ Tested