Results for “assign”
Small, practical examples. Search by task or narrow things down below.
Load environment variables from a file
Docker / Compose: An env file supplies one KEY=value assignment per line.
Docker / Compose✓ Tested
Number a sorted result
Assign a row number without changing stored data.
row_number✓ Tested
Number rows within each group
Assign ordered row numbers with a window function.
row_number✓ Tested
Rank tied scores without gaps
SQL: DENSE_RANK assigns equal ranks to ties and increments by one for the next distinct score.
SQL✓ Tested
Rank tied scores without gaps
SQL Server: DENSE_RANK assigns equal ranks to ties and increments by one for the next distinct score.
SQL Server✓ Tested
Rank tied scores without gaps
Postgres: DENSE_RANK assigns equal ranks to ties and increments by one for the next distinct score.
Postgres✓ Tested
Rank tied scores without gaps
SQLite: DENSE_RANK assigns equal ranks to ties and increments by one for the next distinct score.
SQLite✓ Tested
Read values from an inserted row
Use RETURNING to retrieve an automatically assigned row ID.
RETURNING✓ Tested
Remove an indexed element and compact the array
Bash Scripts: Unsetting an element leaves a gap; reassigning the values creates consecutive indices.
Bash Scripts✓ Tested
Return an array through a nameref
Bash Scripts: Assign through a nameref to preserve array element boundaries.
Bash Scripts✓ Tested
Set an environment value for one child command
Bash Scripts: A command-prefix assignment is visible to that command without overwriting the shell’s current variable.
Bash Scripts✓ Tested
Transform each item in a collection
Build a result array with a foreach expression.
foreach✓ Tested