SQL: GROUP BY Preferable than DISTINCT Why

We should not use DISTINCT in SQL query, it takes more up.

Select distict ename,enum

from emp

where ename=’krishna’

and enum=1000

The alternative way is:

Select ename,enum

from emp

where ename=’krishna’

and enum=1000

group by ename,enum

Related Posts

Discover more from Srinimf

Subscribe now to keep reading and get access to the full archive.

Continue reading