FIND YOUR NEXT FEW LINES

Results for “GROUP BY”

Small, practical examples. Search by task or narrow things down below.

523 snippets foundClear filters
Arduino / CBinary values & packets

Assemble a big-endian 16-bit value

Arduino / C: Cast to an unsigned 16-bit type before shifting the high byte.

Arduino / C✓ Tested
HTMLText semantics

Attach a pronunciation annotation to text

HTML: Ruby and rt represent a base text and its short annotation.

HTML✓ Tested
SQLiteJSON data

Build a JSON array from rows

Aggregate ordered text values into JSON.

json_group_array✓ Tested
CStrings & byte buffers

Check a literal filename suffix

C: Check lengths before subtracting so a short input cannot produce an invalid pointer.

C✓ Tested
CStrings & byte buffers

Check a literal string prefix

C: strncmp compares at most the prefix length; both inputs must be valid strings.

C✓ Tested
PostgresJSON & arrays

Collect ordered values into an array

Build a sorted array from query rows.

array_agg✓ Tested
CStrings & byte buffers

Compare two C strings for equality

C: strcmp returns zero only when both null-terminated byte strings are equal.

C✓ Tested
SQLReporting & grouped calculations

Compute an integer weighted average

SQL: Multiply before summing and guard a zero total weight with NULLIF.

SQL✓ Tested
SQL ServerReporting & grouped calculations

Compute an integer weighted average

SQL Server: Multiply before summing and guard a zero total weight with NULLIF.

SQL Server✓ Tested
PostgresReporting & grouped calculations

Compute an integer weighted average

Postgres: Multiply before summing and guard a zero total weight with NULLIF.

Postgres✓ Tested
SQLiteReporting & grouped calculations

Compute an integer weighted average

SQLite: Multiply before summing and guard a zero total weight with NULLIF.

SQLite✓ Tested
CStrings & byte buffers

Count a leading run of allowed characters

C: strspn counts bytes at the start that belong to a specified character set.

C✓ Tested