FIND YOUR NEXT FEW LINES

Results for “Ownership & optional values”

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

359 snippets foundClear filters
JavaScriptArrays

Remove duplicate values

Use a JavaScript Set to preserve the first occurrence of each primitive value.

JavaScript✓ Tested
SQLBulk changes & set operations

Remove duplicate values while keeping the smallest key

SQL: Identify retained keys in a grouped subquery before deleting other copies.

SQL✓ Tested
SQL ServerBulk changes & set operations

Remove duplicate values while keeping the smallest key

SQL Server: Identify retained keys in a grouped subquery before deleting other copies.

SQL Server✓ Tested
PostgresBulk changes & set operations

Remove duplicate values while keeping the smallest key

Postgres: Identify retained keys in a grouped subquery before deleting other copies.

Postgres✓ Tested
SQLiteBulk changes & set operations

Remove duplicate values while keeping the smallest key

SQLite: Identify retained keys in a grouped subquery before deleting other copies.

SQLite✓ Tested
TypeScriptCollections & records

Remove duplicate values with a Set

Keep the first occurrence order while deduplicating.

Set✓ Tested
C++Collections

Remove odd values

Use the erase-remove idiom to filter a C++ vector in place.

C++✓ Tested
ReactGetting Started

Render an optional notice

Render an optional notice with a small React component and explicit browser behavior.

React✓ Tested
ReactGetting Started

Render nothing from an optional component

Render nothing from an optional component with a small React component and explicit browser behavior.

React✓ Tested
SQLSubqueries & ranked selection

Report duplicate business values and their frequency

SQL: Group by a candidate business key and retain only groups with multiple rows.

SQL✓ Tested
SQL ServerSubqueries & ranked selection

Report duplicate business values and their frequency

SQL Server: Group by a candidate business key and retain only groups with multiple rows.

SQL Server✓ Tested
PostgresSubqueries & ranked selection

Report duplicate business values and their frequency

Postgres: Group by a candidate business key and retain only groups with multiple rows.

Postgres✓ Tested