It is done using the ScenHack tool which comes with the CD version.
To get to it use the Game Options Menu | Utilities | ScenHack:
Go to the Sort Tab and paste the above query in the query edit box and click Run:
Lastly if you'd like to view the results in a file click on the 'Write CSV' button to generate a text file.