Prepare for your Next Interview
This is a discussion on Distinct keyword in Oracle SQL within the SQL forums, part of the Databases category; Hi, I have one doubts in using the Distinct keyword to suppress the duplicates from the performance point of view. Why we should not use the Distinct Keyword in the ...
|
|||
|
Distinct keyword in Oracle SQL
Hi,
I have one doubts in using the Distinct keyword to suppress the duplicates from the performance point of view. Why we should not use the Distinct Keyword in the Select statement. To suppress the duplicate, which one is the best to use to avoid the duplication. while using the Distinct keyword in select clause, I am getting an Performance problem. If any body knows, please let me know. Thanks in advance. Thanks, Saravanan.P |
| Sponsored Links |
|
|||
|
Re: Distinct keyword in Oracle SQL
Quote:
SQL> SELECT DISTINCT DEPTNO,JOB FROM EMP; DEPTNO JOB --------- --------- 10 CLERK 10 MANAGER 10 PRESIDENT 20 ANALYST 20 CLERK 20 MANAGER 30 CLERK 30 MANAGER 30 SALESMAN 9 rows selected. SQL> SQL> SELECT DEPTNO, JOB, COUNT(*) FROM EMP 2 GROUP BY DEPTNO,JOB; DEPTNO JOB COUNT(*) --------- --------- --------- 10 CLERK 1 10 MANAGER 1 10 PRESIDENT 1 20 CLERK 2 20 ANALYST 2 20 MANAGER 1 30 CLERK 1 30 MANAGER 1 30 SALESMAN 4 9 rows selected. |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Load Distinct and Duplicate values to different targets | tanya123 | Data Warehousing | 1 | 02-25-2008 09:06 PM |
| ASM keyword in C language | Geek_Guest | C and C++ | 1 | 08-21-2007 02:01 AM |
| Alternative for SELECT DISTINCT to query 2 million records | Geek_Guest | SQL | 1 | 08-06-2007 09:29 AM |
| difference bet unique and distinct | smitai | Oracle Certification | 2 | 06-18-2007 04:00 AM |
| "like" keyword in oracle.. | psuresh1982 | Oracle | 5 | 12-22-2006 10:19 AM |