Igor Tandetnik wrote: > Well, there's no way to tell how records with the same Date are going to > end up ordered in the original query. If you impose some deterministic > order there, e.g. with > > ORDER BY Date, Id > > then you can do something like this: > > select count(*) > from Data d, (select Date, ID from Data where ID=?) myRow > where PlotOnGraph=1 and d.Date <= myRow.Date and > (d.Date < myRow.Date or d.ID < myRow.ID); > >
Ok, I'll investigate if I can do anything having that as a base - thank you. Unfortunately the results are sorted by the application (so, the grid control sorts them by date, but it doesn't take the ID in to account, so it's impossible to predict what the order is, as compared to the DB's sorted order). A bit of a mess... Dennis _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users