(This is an “answer my own question”-style entry, like on Stackoverflow. I recherched it.)
I was wondering whether we can sort by Difficulty and Terrain separately; some tables have (had?) a combined D/T field, and sometimes I wanted to sort by Terrain first, then Difficulty (e.g. to consider T4 first when filling up my 81 matrix, T4½ later, etc).
In a combined D/T field, this is obviously not possible. When D and T are separate table columns, this is possible with a stable sort.