Re: [sqlite] is it really ok to allow non-aggregates in an aggregate line?

2010-11-12 Thread Nicolas Williams
On Tue, Oct 19, 2010 at 09:39:44AM -0400, Richard Hipp wrote: > On Mon, Oct 18, 2010 at 8:19 AM, wrote: > > > I made an error in my SQL when I did not include one of my non-aggregate > > columns in my group. I was surprised that Sqlite did not catch this, and > > even

Re: [sqlite] is it really ok to allow non-aggregates in an aggregate line?

2010-11-12 Thread Alexey Pechnikov
2010/11/11 Drake Wilson > > It looks like you're right, and the resulting row selected is only > arbitrary (though often the one with the largest rowid). This > suggests that unless I'm misunderstanding the comparison, comparing > SQLite's behavior of permitting this type of

Re: [sqlite] is it really ok to allow non-aggregates in an aggregate line?

2010-11-10 Thread Drake Wilson
Quoth "Jay A. Kreibich" , on 2010-11-10 18:43:06 -0600: > > The observed useful behavior is to have such a reference return the > > value from the first row in each group, > > I haven't verified this since 3.6.23.1, but in that version the > *last* row is the one that is

Re: [sqlite] is it really ok to allow non-aggregates in an aggregate line?

2010-11-10 Thread Jay A. Kreibich
On Wed, Nov 10, 2010 at 03:15:35PM -0700, Drake Wilson scratched on the wall: > The observed useful behavior is to have such a reference return the > value from the first row in each group, I haven't verified this since 3.6.23.1, but in that version the *last* row is the one that is

Re: [sqlite] is it really ok to allow non-aggregates in an aggregate line?

2010-11-10 Thread Drake Wilson
Quoth Alexey Pechnikov , on 2010-10-20 11:32:04 +0400: > This is just one replacement for "distinct on" clause, as example. And you > can use any sort order for non-aggregate values in your group so some > queries are more simple than equal "distinct on" form in other DBMS

Re: [sqlite] is it really ok to allow non-aggregates in an aggregate line?

2010-10-20 Thread Alexey Pechnikov
This is just one replacement for "distinct on" clause, as example. And you can use any sort order for non-aggregate values in your group so some queries are more simple than equal "distinct on" form in other DBMS (PostgreSQL, etc.). The feature is extremely useful for many applications.

Re: [sqlite] is it really ok to allow non-aggregates in an aggregate line?

2010-10-19 Thread Jay A. Kreibich
On Tue, Oct 19, 2010 at 09:39:44AM -0400, Richard Hipp scratched on the wall: > I was going to change this at one point, so that it raised an error, but > that suggestion raised such an outcry that I decided to leave it. > Apparently, there are many applications out there that depend on this >

Re: [sqlite] is it really ok to allow non-aggregates in an aggregate line?

2010-10-19 Thread Richard Hipp
On Mon, Oct 18, 2010 at 8:19 AM, wrote: > I made an error in my SQL when I did not include one of my non-aggregate > columns in my group. I was surprised that Sqlite did not catch this, and > even more surprised when the docs spelled out this behavior. > > Is everyone ok

[sqlite] is it really ok to allow non-aggregates in an aggregate line?

2010-10-18 Thread ivoryjohn13
I made an error in my SQL when I did not include one of my non-aggregate columns in my group. I was surprised that Sqlite did not catch this, and even more surprised when the docs spelled out this behavior. Is everyone ok with this? Do any other SQL engines allow this? (DB2 does not) Sent