Results for “ORDER BY”
Small, practical examples. Search by task or narrow things down below.
Preserve item state while reordering by key
Preserve item state while reordering by key with a small React component and explicit browser behavior.
React✓ Tested
Collect ordered values into an array
Build a sorted array from query rows.
array_agg✓ Tested
Sort records by two fields
C++: Tuple comparison implements lexicographic ordering across several keys.
C++✓ Tested
Select specific columns
Read only the fields a result needs.
SELECT✓ Tested
Select the highest values with TOP
Limit an ordered SQL Server result.
TOP✓ Tested
Count items by group
Group repeated values and report each count.
Group-Object✓ Tested
Count words with GroupBy
Group repeated C# words and print ordered counts.
C#✓ Tested
Enumerate hashtable entries in a stable order
PowerShell: Sort entries by key when predictable output matters.
PowerShell✓ Tested
Group strings by their length
Java: Choose a TreeMap supplier when group keys must have deterministic order.
Java✓ Tested
Initialize structure fields by name
C: Designated initializers make field assignments independent of their declaration order.
C✓ Tested
List files by extension
Enumerate regular files and return their names in order.
Get-ChildItem✓ Tested
Pack and unpack a network-order integer
Python: Use an explicit byte order so the binary format is independent of the host architecture.
Python✓ Tested