DB2-SQL DISTINCT and Group By

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

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

 

Advertisements

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.