At this point, backward compatibility. Enough people use it expecting it to
work that it would be bad to change the behavior.

On Mon, May 9, 2016 at 6:42 PM, dandl <david at andl.org> wrote:

> > bounces at mailinglists.sqlite.org] On Behalf Of Keith Medcalf
>
> > Why are you using BOTH distinct and group by on the same column?  You
> only
> > need one or the other.  If you are redundantly redundant I would hope
> that
> > the optimizer makes redundant (as in gets rid of, for those that are not
> > English) the redundancies ...
>
> This is generated code. Since Andl does not allow any duplicate rows, every
> SELECT gets a DISTINCT unless the query provably cannot generate
> duplicates.
> You need both GROUP BY and DISTINCT in cases where there is an aggregate
> function (and some others). Say:
>
> SELECT DISTINCT SUM(X) AS Y FROM T GROUP BY Z;
>
> There is no way to predict from the query how many rows this will generate.
> Without DISTINCT it can generate duplicates.
>
> My question was really about why Sqlite did not complain on what is
> actually
> not a valid query. [Andl is still a work in progress.]
>
> Regards
> David M Bennett FACS
>
> Andl - A New Database Language - andl.org
>
>
>
>
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
Scott Robison

Reply via email to