SELECT DISTINCT clause with ORDER BY for MSSQL

SELECT DISTINCT clause for a given set of columns and a given ORDER BY clause.

Partially fixes #437