non-aggregate columns in aggregate queries

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

non-aggregate columns in aggregate queries

Jeff Rogers-2
Hi all,

It's a documented quirk that sqlite allows the inclusion of
non-aggregate, non-group by columns in an agregate query:

https://sqlite.org/quirks.html#aggregate_queries_can_contain_non_aggregate_result_columns_that_are_not_in_the_group_by_clause

The benefits aside, it's not "standard sql", or at a minimum most other
databases do not allow it.  Could a pragma or build-time flag be added
to enforce "standard" behavior, i.e., raising an error rather than
handling it as currently documented?


-J

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: non-aggregate columns in aggregate queries

Simon Slavin-3
On 6 Sep 2019, at 11:40pm, Jeff Rogers <[hidden email]> wrote:

> Could a pragma or build-time flag be added to enforce "standard" behavior, i.e., raising an error rather than handling it as currently documented?

I think this is one of the things mentioned in

<https://sqlite.org/src/wiki?name=StrictMode>

which, of course, discusses a feature which doesn't exist.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users