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
Beth,
Without going into very much detail about the two selects. 1 will
return only the records that are distinct from each other and 2 will
return all rows in a particular order. Using 1 could result in the
elimination of records if there is more than one record that meets the
distinct
Seefelt, Beth wrote:
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
The second one does not make sense. Group by is normally used when you
are including a function that would return a single value (like sum or
count) and yet want to have more than one row returned because you are
including a column that is not within the function
so 1 is definitely more correct
by: Subject: Re: Select DISTINCT question
root@fatcity.
com
I think Ron is talking about ORDER BY instead of GROUP BY ...
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 06, 2002 11:08 AM
To: Multiple recipients of list ORACLE-L
Subject: Re: Select DISTINCT question
Ron,
What am I
--
Please see the official ORACLE-L FAQ: htt
p://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
]
ttery.org cc:
Sent by: Subject: Re: Select DISTINCT question
root@fatcity
Beth is correct in her statement. I'm sorry if some of my responses to
this question are getting cut off but the network people are working on
upgrading the email service. listed is my response to tom that was
clipped by the email server.
---
Rick,
You are correct. Both statements will return