Converting Access DISTINCTROW to TSQL

Make sure to test it. One against access the other again sql