Tables: Multiple column sorting possible?

We’ve got examples on how to sort a table by a column - but is there any way to sort it based on two columns, like, first by surname, then by name?

Has anyone ever written a script or found a way to do so?

Thanks in advance,