Results for “set”
Small, practical examples. Search by task or narrow things down below.
Find rows shared by two query results
SQL: INTERSECT compares complete selected rows and removes duplicates.
SQL✓ Tested
Find rows shared by two query results
SQL Server: INTERSECT compares complete selected rows and removes duplicates.
SQL Server✓ Tested
Find rows shared by two query results
Postgres: INTERSECT compares complete selected rows and removes duplicates.
Postgres✓ Tested
Find rows shared by two query results
SQLite: INTERSECT compares complete selected rows and removes duplicates.
SQLite✓ Tested
Find the insertion position for a sorted value
C++: lower_bound returns the first position whose value is not less than the search key.
C++✓ Tested
Find values missing from another collection
Python: Use a set difference to identify requested IDs absent from the available IDs.
Python✓ Tested
Find values shared by two collections
Python: Use set intersection and sort the result for deterministic display.
Python✓ Tested
Give related form fields a shared title
HTML: Learn how to give related form fields a shared title in a complete browser example.
HTML✓ Tested
Group matching values while preserving their order
C++: stable_partition keeps the relative order within both predicate groups.
C++✓ Tested
Group records by a field
Python: Accumulate related values with defaultdict without checking whether each group exists.
Python✓ Tested
Group related form controls semantically
Group related form controls semantically with a small React component and explicit browser behavior.
React✓ Tested
Increment a stored value in the database
SQL: An in-database arithmetic update avoids a separate application read-modify-write step.
SQL✓ Tested