Results for “lcm”
Small, practical examples. Search by task or narrow things down below.
Select values in an inclusive range
SQL Server: BETWEEN includes both endpoints of the range.
SQL Server✓ Tested
Serialize query rows as JSON
Return a JSON array directly from a SELECT.
FOR JSON✓ 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
Sort preferred rows ahead of other rows
SQL Server: A CASE ordering key expresses business priority before a stable secondary sort.
SQL Server✓ Tested
Sort the highest quantities first
SQL Server: Specify descending order and a stable tie breaker.
SQL Server✓ Tested
Split delimited text with positions
Retain original order with STRING_SPLIT ordinals.
STRING_SPLIT✓ Tested
Substitute a value for NULL
Use SQL Server’s ISNULL expression.
ISNULL✓ Tested
Sum a row and its immediate predecessor
SQL Server: A ROWS frame counts physical ordered rows rather than all peers with the same sort value.
SQL Server✓ Tested
Treat an empty trimmed value as missing
SQL Server: NULLIF converts an empty string to NULL before a fallback is applied.
SQL Server✓ Tested
Turn a condition into a result label
SQL Server: Use CASE to describe stock availability for each row.
SQL Server✓ Tested
Turn JSON into typed rows
Project JSON array items into SQL columns.
OPENJSON✓ Tested
Turn known group values into columns
SQL Server: Conditional aggregation gives a portable pivot when the category set is known.
SQL Server✓ Tested