Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

How do I eliminate the duplicate rows ?

user-image
Question added by Dua'a Hamed .M AlQwasmi , Oracle forms and Java EE Developer , الجامعه الأردنية - The University Of Jordan
Date Posted: 2013/11/03

You can use following ways to eliminate duplicates

1)  DISTINCT

 EX:

----

 SELECT DISTINCT deptno FROM emp;

 

2) ROWID

EX:

---

SELECT deptno FROM emp e WHERE ROWID = (SELECT MAX(ROWID) FROM EMP a WHERE e.deptno = a.deptno);

3) Analytic function:

EX:

---

SELECT deptno FROM(SELECT deptno, ROW_NUMBER() OVER(PARTITION BY deptno ORDER BY deptno) rn FROM emp) WHERE rn =1;

 

 

Thanks,

Ann Pricks E

karthikeyan P
by karthikeyan P , Manager , Indusind Bank

Use Distinct function..... Select Distinct Column from Table... this help you to eliminate duplicate 

More Questions Like This

Do you need help in adding the right keywords to your CV? Let our CV writing experts help you.