Re: Distinct or Group by

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Mikito Harakiri (mikharakiri_nospaum_at_yahoo.com)
Date: 11/19/04


Date: 19 Nov 2004 15:00:08 -0800


"Reg Besseling" <regbes.nospam@hotmail.com> wrote in message news:<08adnRRaBcSqDQHcRVn-2Q@is.co.za>...
> Is it more efficient to use
>
> select MyValue
> from MyTable
> group by MyValue
>
> or
>
> Select distinct MyValue
> from MyTable

They always return the same set of values, right? Suppose they indeed
to have different implementations, and one happen to be more efficient
than the other. Then, it might be easily argued that optimizer have
chosen inefficient implementation in one of the cases.