Re: [sqlite] GROUP BY malfunction?

2010-12-16 Thread _ Robal _
Hi there... I did found (working) solution - retrieve all rows off the database with 'order by date asc' and deal with it in php by overwriting $line[$id] variable with every row. Simply as that! It works perfectly (at least for small datasets as I do have - I predict no more than 2k of rows) but

Re: [sqlite] GROUP BY malfunction?

2010-12-15 Thread Igor Tandetnik
On 12/15/2010 9:49 PM, _ Robal _ wrote: > I tried all of them... none working I'm afraid... Seems to me like it > can't access external > query fields from sub-query. Giving me always error - 'l1.lineID' is > unknown column... Must be a limitation of SQLite v2. It should work with v3. v2 is ancien

Re: [sqlite] GROUP BY malfunction?

2010-12-15 Thread _ Robal _
Hi there... Thanks for your reply! > Works for me, I get two rows. Not the ones you expect though: nothing says > that the > engine must choose the first (or last, or any particular) row to represent > the group. After trying so many invalid constructions that was the only one that was giving

Re: [sqlite] GROUP BY malfunction?

2010-12-15 Thread Igor Tandetnik
On 12/15/2010 1:34 PM, _ Robal _ wrote: > What I'm trying to do is to get the whole rows with unique lineID's > and biggest date value... kinda like versioning. > > but sqlite keeps returning just single row, no matter how many rows > should be returned. > > The statement I use goes as follows:

[sqlite] GROUP BY malfunction?

2010-12-15 Thread _ Robal _
Hi there... I usually use mysql as a database engine, but sqlite has few unique features that came handy in my last project, so... here I am :-) Everything went well until yesterday, when I stumbled upon some strange behavior... Example database: +++--+-+ | ID | lineID