Unable to apply order by clause on distinct select in Oracle
You can't order by columns that aren't selected when using DISTINCT, or their alias. 

To keep your order with a substring and another column, you will have to calculate them first (without DISTINCT), then just display the name while ordering by the other columns behind the curtain.

SELECT
    F.name
FROM
    (
        SELECT 
            S.name name,
            Substr(S.name, -3, 3) substrName,
            MAX(S.ID) ID
        FROM
            Students S
        WHERE
            S.marks &gt; 75
        GROUP BY
            S.name
    ) F
ORDER BY
    substrName,
    ID ASC