Results for “array_agg”
Small, practical examples. Search by task or narrow things down below.
Serialize query rows as JSON
Return a JSON array directly from a SELECT.
FOR JSON✓ Tested
Set an image’s default command
Use JSON array syntax for a predictable command.
Dockerfile✓ Tested
Set several selected options
jQuery: Passing an array to val selects matching values in a multiple select.
jQuery✓ Tested
Show a group total beside each detail row
SQL: A partitioned aggregate preserves detail rows instead of collapsing them with GROUP BY.
SQL✓ Tested
Show a group total beside each detail row
SQL Server: A partitioned aggregate preserves detail rows instead of collapsing them with GROUP BY.
SQL Server✓ Tested
Show a group total beside each detail row
Postgres: A partitioned aggregate preserves detail rows instead of collapsing them with GROUP BY.
Postgres✓ Tested
Show a group total beside each detail row
SQLite: A partitioned aggregate preserves detail rows instead of collapsing them with GROUP BY.
SQLite✓ Tested
Sort numbers numerically
Supply a numeric comparator instead of JavaScript string sorting.
JavaScript✓ Tested
Split values into fixed-size chunks
C#: Enumerable.Chunk creates arrays and allows a shorter final chunk.
C#✓ Tested
Sum numeric values
Provide an initial accumulator for JavaScript reduce, including empty arrays.
JavaScript✓ Tested
Sum values per category
Calculate a grouped total.
SUM✓ Tested
Transform each item with Select
C#: Project each input value into a new value without modifying the source array.
C#✓ Tested