RE: SQL DISTINCT alternate

2001-06-21 Thread Toepke, Kevin M
There are also a lot of cases where you can get rid of a subquery. Consider the following SELECT DISTINCT emplid FROMemp_history eh1 WHERE salary > 10; SELECT emplid FROM emp_history eh1 WHERE rowid = (SELECT MAX(rowid) FROM emp_history eh2 WHERE eh1.emplid = eh2.emplid

Re: SQL DISTINCT alternate

2001-06-20 Thread Stephane Faroult
"Toepke, Kevin M" wrote: > > As I see it, there are several questions here: > 1) Can I use DISTINCT to do a sort? > Yes and no. In Oracle 7, a DISTINCT does an implicit sort > In Oracle 8, it does a "SORT NOSORT" operation. Dupicates are > removed but the output is NOT guaran

RE: SQL DISTINCT alternate

2001-06-20 Thread Toepke, Kevin M
As I see it, there are several questions here: 1) Can I use DISTINCT to do a sort? Yes and no. In Oracle 7, a DISTINCT does an implicit sort In Oracle 8, it does a "SORT NOSORT" operation. Dupicates are removed but the output is NOT guaranteed to be in sorted order. 2) Ho

Re: SQL DISTINCT alternate

2001-06-20 Thread William Beilstein
UNIQUE is just another way of saying DISTINCT. They do the same thing. >>> [EMAIL PROTECTED] 06/20/01 02:26PM >>> What about using UNIQUE Select UNIQUE. Seema Singh wrote: > Hi > In a sql stmt what will be the impact if we used DISTINCT clause and how we > can overcomes on the performa

Re: SQL DISTINCT alternate

2001-06-20 Thread Luis DeUrioste
What about using UNIQUE Select UNIQUE. Seema Singh wrote: > Hi > In a sql stmt what will be the impact if we used DISTINCT clause and how we > can overcomes on the performance bottleneck caused by DISTINCT. > like ... SELECT DISTINCT A,B,C FROM TAB_1 > I want to get same output without

SQL DISTINCT alternate

2001-06-20 Thread Seema Singh
Hi In a sql stmt what will be the impact if we used DISTINCT clause and how we can overcomes on the performance bottleneck caused by DISTINCT. like ... SELECT DISTINCT A,B,C FROM TAB_1 I want to get same output without using distinct?Is this possible?If, YES then how? Thanks in advance -Seema __