IMHO since they both require Oracle to sort the table and you are doing a
full table scan in both cases the performance would be
virtually the same.

Rick


                                                                                       
                                 
                    "Seefelt, Beth"                                                    
                                 
                    <Beth.Seefelt@tetl        To:     Multiple recipients of list 
ORACLE-L <[EMAIL PROTECTED]>       
                    eyusa.com>                cc:                                      
                                 
                    Sent by:                  Subject:     Select DISTINCT question    
                                 
                    [EMAIL PROTECTED]                                                   
                                 
                                                                                       
                                 
                                                                                       
                                 
                    02/06/2002 09:53                                                   
                                 
                    AM                                                                 
                                 
                    Please respond to                                                  
                                 
                    ORACLE-L                                                           
                                 
                                                                                       
                                 
                                                                                       
                                 







Hi everyone,


Is one of these more correct than the other ?


1)      select distinct customer_number, address_code from orders;


2)      select customer_number, address_code
           from orders
           group by customer_number,address_code;





Our developers do the 1st one mostly.  It always bothers me, I'm not sure
why, I guess I just think of it as looking ambiguous even though it does
return the same result as the second option.


Any opinions?  Does it matter at all?


TIA,


Beth







-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: 
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to