FIND YOUR NEXT FEW LINES

Results for “PARTITION BY”

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

427 snippets foundClear filters
JavaStream transformations

Partition a collection by a predicate

Java: Use partitioningBy to retain both matching and nonmatching values.

Java✓ Tested
SQL ServerSelect & page

Assign a rank within each group

Number rows with a partitioned window.

ROW_NUMBER✓ Tested
PostgresWindows & text

Number rows within each group

Assign ordered row numbers with a window function.

row_number✓ Tested
SQLWindow analytics

Show a group total beside each detail row

SQL: A partitioned aggregate preserves detail rows instead of collapsing them with GROUP BY.

SQL✓ Tested
SQL ServerWindow analytics

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
PostgresWindow analytics

Show a group total beside each detail row

Postgres: A partitioned aggregate preserves detail rows instead of collapsing them with GROUP BY.

Postgres✓ Tested
SQLiteWindow analytics

Show a group total beside each detail row

SQLite: A partitioned aggregate preserves detail rows instead of collapsing them with GROUP BY.

SQLite✓ Tested
PythonDates & time zones

Advance a date by a number of days

Python: Use timedelta so month and year boundaries are handled automatically.

Python✓ Tested
Arduino / CBinary values & packets

Calculate a CRC-8 over a byte sequence

Arduino / C: This implementation uses polynomial 0x07, initial zero, and no reflection.

Arduino / C✓ Tested
C++Ownership & optional values

Capture configuration by value in a callable

C++: A value capture retains the value from lambda creation even if the original variable changes later.

C++✓ Tested
GoTesting & reusable helpers

Check whether bytes contain valid JSON

Check whether bytes contain valid JSON using a complete Go program with explicit sample inputs.

Go✓ Tested
CStrings & byte buffers

Compare binary buffers including zero bytes

C: memcmp checks an explicit byte length rather than stopping at a string terminator.

C✓ Tested