Results for “array_agg”
Small, practical examples. Search by task or narrow things down below.
Find the index of an array item
PowerShell: Array.IndexOf returns -1 when the requested item is absent.
PowerShell✓ Tested
Find the largest array value
Track the maximum in a nonempty C integer array.
C✓ Tested
Find the smallest value in a nonempty array
C: Initialize from the first element instead of assuming a numeric sentinel.
C✓ Tested
Insert into an array with spare capacity
C: Move the trailing elements before inserting and keep the logical length separate from capacity.
C✓ Tested
Iterate over a fixed array of records
C: Compute the array element count with sizeof at the point where it is still an array.
C✓ Tested
Iterate with array indices and values
JavaScript: entries provides each position and value without a separate counter.
JavaScript✓ Tested
Iterate with array indices and values
TypeScript: entries provides each position and value without a separate counter.
TypeScript✓ Tested
Join a parent to pre-aggregated totals
SQL: Aggregate the child rows first to produce at most one joined row per parent.
SQL✓ Tested
Join a parent to pre-aggregated totals
SQL Server: Aggregate the child rows first to produce at most one joined row per parent.
SQL Server✓ Tested
Join a parent to pre-aggregated totals
Postgres: Aggregate the child rows first to produce at most one joined row per parent.
Postgres✓ Tested
Join a parent to pre-aggregated totals
SQLite: Aggregate the child rows first to produce at most one joined row per parent.
SQLite✓ Tested
Join an array into text
PowerShell: Join an array into text using PowerShell 7.
PowerShell✓ Tested