- The ORDER BY clause does not work with DISTINCT in that way. If you want to order the results by the name column, you should simply use:
SELECT * FROM role ORDER BY name;
If you want to get distinct role names (though in this case, they are already unique), you can use:
SELECT DISTINCT name FROM role ORDER BY name;
Written by A.M. Rinas