Re: [sqlite] find sequential groups

2012-10-17 Thread Bart Smissaert
Thanks. Have a feeling I made this same mistake before and posted to this forum as well ... RBS On Wed, Oct 17, 2012 at 4:13 AM, Igor Tandetnik wrote: > Bart Smissaert wrote: >> To do with the same, what is wrong with this update SQL? >> >>

Re: [sqlite] find sequential groups

2012-10-16 Thread Igor Tandetnik
Bart Smissaert wrote: > To do with the same, what is wrong with this update SQL? > > update final2 > set group_count = > (select count(*) > from > final2 > group by > group_marker) > > It makes group_count always 1 The subquery does not depend on the values in the row

Re: [sqlite] find sequential groups

2012-10-16 Thread Bart Smissaert
To do with the same, what is wrong with this update SQL? update final2 set group_count = (select count(*) from final2 group by group_marker) It makes group_count always 1, but should include higher values. The select by itself gives the right result. RBS On Wed, Oct 17, 2012 at 12:31 AM, Bart

Re: [sqlite] find sequential groups

2012-10-16 Thread Bart Smissaert
Without the concatenation it runs fine, enormously faster than with the concatenation. Have checked and the result is fine as well. Thanks again. RBS On Tue, Oct 16, 2012 at 11:38 PM, Igor Tandetnik wrote: > On 10/16/2012 6:29 PM, Bart Smissaert wrote: >> >> Actually, it

Re: [sqlite] find sequential groups

2012-10-16 Thread Bart Smissaert
> From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on > behalf of Bart Smissaert [bart.smissa...@gmail.com] > Sent: Tuesday, October 16, 2012 5:45 PM > To: General Discussion of SQLite Database > Subject: EXT :Re: [sqlite] fi

Re: [sqlite] find sequential groups

2012-10-16 Thread Black, Michael (IS)
s-boun...@sqlite.org] on behalf of Bart Smissaert [bart.smissa...@gmail.com] Sent: Tuesday, October 16, 2012 5:45 PM To: General Discussion of SQLite Database Subject: EXT :Re: [sqlite] find sequential groups Thanks, will try that. Yes, the ID field is an integer primary key autoincrement. Still

Re: [sqlite] find sequential groups

2012-10-16 Thread Bart Smissaert
Thanks, will try that. Yes, the ID field is an integer primary key autoincrement. Still running the old sql with concatenation. Looks I may need to kill that. RBS On Tue, Oct 16, 2012 at 11:38 PM, Igor Tandetnik wrote: > On 10/16/2012 6:29 PM, Bart Smissaert wrote: >> >>

Re: [sqlite] find sequential groups

2012-10-16 Thread Igor Tandetnik
On 10/16/2012 6:29 PM, Bart Smissaert wrote: Actually, it really is slow, made worse by the fact that there is not one grouping field (value in my example), but three. I am running your SQL now, concatenating these 3 fields, but still running and looks will be a long time. Will have to improve

Re: [sqlite] find sequential groups

2012-10-16 Thread Bart Smissaert
Thanks, very nice solution that! Yes, I realise that this is a lot faster in code, but for now that is no option. Actually, it really is slow, made worse by the fact that there is not one grouping field (value in my example), but three. I am running your SQL now, concatenating these 3 fields, but

Re: [sqlite] find sequential groups

2012-10-16 Thread Igor Tandetnik
On 10/16/2012 4:56 PM, Bart Smissaert wrote: Trying to make a query that can mark records, indicating them to belong to a sequential group. Giving the most simple example: IDValue Group_Marker --- 1 D1 2 X 2 3 X 2

[sqlite] find sequential groups

2012-10-16 Thread Bart Smissaert
Trying to make a query that can mark records, indicating them to belong to a sequential group. Giving the most simple example: IDValue Group_Marker --- 1 D1 2 X 2 3 X 2 4 X 2 5 A 3 6 B