Results for “groups”
Small, practical examples. Search by task or narrow things down below.
Extract named regex fields
Python: Use named capture groups to parse a known date-shaped identifier.
Python✓ Tested
Get the latest row in each group
Select one ordered row per key with DISTINCT ON.
DISTINCT ON✓ Tested
Read named fields from a successful regex match
PowerShell: The Matches table is updated after a successful scalar match operation.
PowerShell✓ Tested
Count items by group
Group repeated values and report each count.
Group-Object✓ Tested
Create a reusable one-to-many lookup
C#: ToLookup groups values by key and returns an empty sequence for an unknown key.
C#✓ Tested
Filter rows before grouping
SQL: WHERE limits the rows contributing to the aggregate; it differs from filtering completed groups with HAVING.
SQL✓ Tested
Filter rows before grouping
SQL Server: WHERE limits the rows contributing to the aggregate; it differs from filtering completed groups with HAVING.
SQL Server✓ Tested
Filter rows before grouping
Postgres: WHERE limits the rows contributing to the aggregate; it differs from filtering completed groups with HAVING.
Postgres✓ Tested
Filter rows before grouping
SQLite: WHERE limits the rows contributing to the aggregate; it differs from filtering completed groups with HAVING.
SQLite✓ Tested
Find what remains after division
Python: Use the remainder operator to count items left after forming complete groups.
Python✓ Tested
Find what remains after division
C#: Use the remainder operator to count items left after forming complete groups.
C#✓ Tested
Find what remains after division
Java: Use the remainder operator to count items left after forming complete groups.
Java✓ Tested