Results for “join”
Small, practical examples. Search by task or narrow things down below.
Print only duplicate values
Linux Commands: Use uniq -d after sorting to report each repeated value once.
Linux Commands✓ Tested
Sort lines by numeric value
Linux Commands: Use sort -n so 10 sorts after 2 instead of before it.
Linux Commands✓ Tested
Sort records by a delimited field
Linux Commands: Select the exact sort key to avoid including later columns.
Linux Commands✓ Tested
Sort values in descending order
Linux Commands: Combine numeric sorting with reverse order.
Linux Commands✓ Tested
Sort version-like labels naturally
Linux Commands: Use GNU version sort to compare embedded digit runs numerically.
Linux Commands✓ Tested
Compare with a calculated value
Find products above the average price.
subquery✓ Tested
Find rows with a related record
Use EXISTS without duplicating the outer rows.
EXISTS✓ Tested
Include zero counts for missing relationships
SQL: Count the non-null child key after a left join so a missing relationship produces zero.
SQL✓ Tested
Include zero counts for missing relationships
SQL Server: Count the non-null child key after a left join so a missing relationship produces zero.
SQL Server✓ Tested
Include zero counts for missing relationships
Postgres: Count the non-null child key after a left join so a missing relationship produces zero.
Postgres✓ Tested
Include zero counts for missing relationships
SQLite: Count the non-null child key after a left join so a missing relationship produces zero.
SQLite✓ Tested
List unordered pairs without duplicate reversals
SQL: Join using an increasing key comparison to omit self-pairs and reversed duplicates.
SQL✓ Tested