|
EMP |
ID |
Name |
Country |
Salary |
1 |
Vijay |
India |
6000 |
2 |
Bill |
USA |
8000 |
3 |
Kris |
France |
3000 |
4 |
Bhagat |
India |
2000 |
5 |
Steve |
USA |
1000 |
|
---- Low Performance by using GROUP BY
SELECT Country
FROM EMP
WHERE ID BETWEEN 1 AND 5
GROUP BY Country
---- High Performance by using DISTINCT
SELECT DISTINCT Country
FROM EMP
WHERE ID BETWEEN 1 AND 5
---- both Queries will give the same output but Performance is different, if the data is tooooo big
Output |
Country |
France |
India |
USA |
|