Re: [sqlite] Re: SQL Challenge, select stack

2007-07-20 Thread Ken
Igor, I ran your cases and came up with this after adding the (22 record to the stack)... sqlite> explain query plan ...> ...> select s.id, p.id ...>from stack s, stackpop p ...> where s.value = p.value ...> and s.id < p.id ...> and (select count(*)

Re: [sqlite] Re: SQL Challenge, select stack

2007-07-20 Thread Ken
Igor, et al. The first time I posted the question took over 5 hours to get there and back to me. So I assumed that the first question was lost and reposted the question with a small update to reflect the actual problem that wasn't represented in the first case.. My mistake. The 22 is kin

[sqlite] Re: SQL Challenge, select stack

2007-07-20 Thread Igor Tandetnik
Ken wrote: Does anyone have ideas on how to implement a stack using sql Given the following tables and data: create table stack( id integer primary key, value integer); create table stackpop ( id integer primary key, value integer ); begin; insert into stack values (1, 1234); inse

[sqlite] Re: SQL Challenge: select stack

2007-07-19 Thread Igor Tandetnik
Ken wrote: Does anyone have ideas on how to implement a stack using sql Given the following tables and data: create table stack( id integer primary key, value integer); create table stackpop ( id integer primary key, value integer ); begin; insert into stack values (1, 1234); insert int