Results for “table variable”
Small, practical examples. Search by task or narrow things down below.
Format a date without locale ambiguity
Parse an ISO date and format it consistently.
date✓ Tested
Format a zero-padded numeric label
Linux Commands: Use printf formatting instead of concatenating a variable number of zeroes.
Linux Commands✓ Tested
Generate a bounded sequence recursively
Use a recursive CTE with a recursion limit.
recursive CTE✓ Tested
Generate a sequence of numbers
Create rows without a stored table.
generate_series✓ Tested
Generate every combination of two sets
SQL: CROSS JOIN creates one result per possible pair, so the output size is the product of the input sizes.
SQL✓ Tested
Give a function an optional argument
Let callers omit a value while keeping nounset enabled.
optional argument✓ Tested
Give a result column a readable name
SQL: Use AS to label a computed result column.
SQL✓ Tested
Give an LED pin a constant name
Arduino / C: Use const to name the built-in LED pin and reuse it in output instructions.
Arduino / C✓ Tested
Group by more than one field
SQL: Each distinct combination of grouping fields produces its own row.
SQL✓ Tested
Group matching values while preserving their order
C++: stable_partition keeps the relative order within both predicate groups.
C++✓ Tested
Handle a malformed JSON document
PowerShell: ConvertFrom-Json reports a terminating conversion error under the selected error preference.
PowerShell✓ Tested
Handle a terminating error
Catch conversion failures and produce a clear fallback.
try catch✓ Tested