Reading your response, thinks.
I did however find that the incoming data did not conform to what I
expects (contiguous series_id),
so the code worked, my thinking did not.

On 5/10/10, Tim Romano <tim.romano...@gmail.com> wrote:
> The select/group by part of your statement will group table SERIESDATA by
> text-column series_id (aliased to id) and return the min and max data_index
> for each grouping, assuming those columns are populated with data for each
> row.  The set will have three columns and some number of rows, one per id.
>
> id |  min(data_index) | max(data_index)
>
> However, it is not clear to me where you want to put that aggregated set. Do
> you have another *table* called SERIESID with those three columns in it?
>
>
> Regards
> Tim Romano
> Swarthmore PA
>
>
> On Mon, May 10, 2010 at 2:43 AM, Matt Young <youngsan...@gmail.com> wrote:
>
>> # series data looks like:
>> create table seriesdata (
>>        data_index INTEGER PRIMARY KEY autoincrement,
>>        series_id text,
>>        year numeric,
>>        value numeric);
>> # and is filled
>> insert into seriesid
>>        select
>>                s.series_id as id, min(data_index),max(data_index)
>>        from
>>                seriesdata as s
>>        group by
>>                id;
>>
>> # I intend seriesid to pick up the minand max values of data_index for
>> each unique series_id
>> _______________________________________________
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to