SQL simple
->
To use DISTINCT everywhere is a bad habit
Try to see whether your query really needs the
DISTINCT
clause. If you want to select distinc values of city names from Customers table, why not to use
GROUP BY
?
SELECT DISTINCT City
FROM Customers;
/* GROUP BY can help to recive same results */
SELECT City
FROM Customers
GROUP BY City;
sqlexamples.info