Results for “DISTINCT ON”
Small, practical examples. Search by task or narrow things down below.
Find rows in the first result but not the second
SQL Server: EXCEPT calculates a distinct result-set difference.
SQL Server✓ Tested
Find rows in the first result but not the second
Postgres: EXCEPT calculates a distinct result-set difference.
Postgres✓ Tested
Find rows in the first result but not the second
SQLite: EXCEPT calculates a distinct result-set difference.
SQLite✓ Tested
Find values common to two collections
C#: Intersect returns distinct values shared by the inputs.
C#✓ Tested
Group by more than one field
SQL: Each distinct combination of grouping fields produces its own row.
SQL✓ Tested
Group by more than one field
SQL Server: Each distinct combination of grouping fields produces its own row.
SQL Server✓ Tested
Group by more than one field
Postgres: Each distinct combination of grouping fields produces its own row.
Postgres✓ Tested
Group by more than one field
SQLite: Each distinct combination of grouping fields produces its own row.
SQLite✓ Tested
Rank tied scores without gaps
SQL: DENSE_RANK assigns equal ranks to ties and increments by one for the next distinct score.
SQL✓ Tested
Rank tied scores without gaps
SQL Server: DENSE_RANK assigns equal ranks to ties and increments by one for the next distinct score.
SQL Server✓ Tested
Rank tied scores without gaps
Postgres: DENSE_RANK assigns equal ranks to ties and increments by one for the next distinct score.
Postgres✓ Tested
Rank tied scores without gaps
SQLite: DENSE_RANK assigns equal ranks to ties and increments by one for the next distinct score.
SQLite✓ Tested