Top 10 SQL Performance Tips 2
by alamster in November 22nd, 2006
Another tip :
“Don’t use DISTINCT when you have or could use GROUP BY”
I prefer to use GROUP BY than DISTINCT since I can retrieve more field.
SELECT DISTINCT town_name from city;
SELECT town_id, town_zip, town_name from city group by town_name;
the result also not quite accurate using DISTINCT, I still have duplicate data.
Keep learn, get new stuff
- sql select performance tip






No Comment
Random Post
Leave Your Comments Below