Anyone? I need to understand which index to create and how to fix the query.
Thank you. On Tue, Nov 12, 2013 at 6:17 PM, Igor Korot <ikoro...@gmail.com> wrote: > Hi, Simon, > > On Tue, Nov 12, 2013 at 2:18 PM, Simon Slavin <slav...@bigfraud.org> wrote: >> >> On 12 Nov 2013, at 9:41pm, Igor Korot <ikoro...@gmail.com> wrote: >> >>> I don't see what is wrong. It should be using foreign key constraints >>> on the last two searches, but it looks like it does not. >> >> Did you actually create the indexes which would be useful for those >> constraints, or did you just specify the constraints ? >> >> <http://www.sqlite.org/foreignkeys.html#fk_indexes> > > I just specify the constraints. > But I may have a bigger problem. Running this query gives an endless > loop. So there is some kind of logic error in this query. > > Basically this is what I am looking for: > > There is a league with assigned players. And there are 2 kind of > players: hitters and pitchers (baseball game). > Those kind is identified by the ishitter field in the playersinleague table. > > Each kind have different score types and each player assigned their > own score according to the score types assigned to the kind. > > What I want is to retrieve the score for each player no matter whether > it's a hitter or a pitcher. > > Can I do it in one query or it has to be done in two? > > Thank you. > > P.S.: If you need to see a DB schema - just ask and I will provide it. > >> >> Simon. >> _______________________________________________ >> 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