FIND YOUR NEXT FEW LINES

Results for “or”

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

2638 snippets foundClear filters
SQLiteReporting & grouped calculations

Filter rows before grouping

SQLite: WHERE limits the rows contributing to the aggregate; it differs from filtering completed groups with HAVING.

SQLite✓ Tested
C++Ordering & set operations

Find a median element without fully sorting

C++: nth_element partitions around the element that would occupy the chosen sorted position.

C++✓ Tested
C++Sequence algorithms

Find both extremes in one algorithm call

C++: Check for a nonempty input before dereferencing the returned iterators.

C++✓ Tested
PythonNumbers & calculations

Find common factors and multiples

Python: Use the integer gcd and lcm helpers to avoid floating-point calculations.

Python✓ Tested
Linux CommandsSorting & joining records

Find lines common to two sorted files

Linux Commands: Use comm -12 to suppress the two columns of unmatched lines.

Linux Commands✓ Tested
Linux CommandsSorting & joining records

Find lines unique to the first sorted file

Linux Commands: Use comm -23 to retain only records absent from the second input.

Linux Commands✓ Tested
SQLRelationships & missing data

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
SQL ServerRelationships & missing data

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
PostgresRelationships & missing data

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
SQLiteRelationships & missing data

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
SQLJoins & subqueries

Find rows with a related record

Use EXISTS without duplicating the outer rows.

EXISTS✓ Tested
C++Ordering & set operations

Find sorted set members missing from another set

C++: set_difference writes elements present in the first sorted input but absent from the second.

C++✓ Tested