6.18 Sorting Records
6.18 Sorting Records Sorting records means sorting structured values by one or more fields. The record itself usually contains more information than the key used for ordering. The sorting algorithm must move the whole record while comparing only the selected fields. Problem You have records such as: (name, department, salary, hired_at) You want to sort them by a rule such as: department ascending salary descending hired_at ascending Solution Define a...