FIND YOUR NEXT FEW LINES

Results for “when”

Small, practical examples. Search by task or narrow things down below.

230 snippets foundClear filters
TypeScriptArray restructuring

Keep both matching and rejected values

TypeScript: Use two explicit outputs when a caller needs both sides of a classification.

TypeScript✓ Tested
SQLRelationships & missing data

Keep parent rows while filtering joined children

SQL: Put a child filter in ON when unmatched parents must remain in the result.

SQL✓ Tested
SQL ServerRelationships & missing data

Keep parent rows while filtering joined children

SQL Server: Put a child filter in ON when unmatched parents must remain in the result.

SQL Server✓ Tested
PostgresRelationships & missing data

Keep parent rows while filtering joined children

Postgres: Put a child filter in ON when unmatched parents must remain in the result.

Postgres✓ Tested
SQLiteRelationships & missing data

Keep parent rows while filtering joined children

SQLite: Put a child filter in ON when unmatched parents must remain in the result.

SQLite✓ Tested
SQLJoins & subqueries

Keep unmatched rows with LEFT JOIN

Show every product even when stock is missing.

LEFT JOIN✓ Tested
SQLExpressions & aggregates

Label rows with CASE

Derive a readable label from a condition.

CASE✓ Tested
SQLSelect & filter

List distinct values

Remove duplicate category values from a result.

DISTINCT✓ Tested
Linux CommandsSearching text

List files containing a match

Linux Commands: Use grep -l when only the matching filenames are needed.

Linux Commands✓ Tested
SQLSelect & filter

Match one of several values

Use IN to avoid repeating equality conditions.

IN✓ Tested
GitBranches & recovery

Merge a branch only by fast-forward

Refuse to create an unexpected merge commit.

merge✓ Tested
PythonCollections

Merge two dictionaries

Combine two dictionaries into a new dictionary. When a key appears in both inputs, the value from the second dictionary wins.

dictionary✓ Tested