У меня есть запрос
SELECT c.*, sum(cnt.count) AS Questions FROM chapters c
JOIN( SELECT q.chapterid, count(q.chapterid) AS count, t.LinkChapter
FROM questions q
JOIN( SELECT DISTINCT questionid, LinkChapter FROM questionstests
WHERE testid = '"+ testID +"' )t ON t.questionid = q.questionid
GROUP BY q.chapterid,t.LinkChapter )cnt
ON cnt.chapterid = c.chapterid OR cnt.LinkChapter = c.ChapterID
GROUP BY c.ChapterID ORDER BY SortBy
, который отлично работал на sqlite 3.6.22, но выдает исключение «Не удалось построить итератор» на sqlite 3.5.9. Кто-нибудь может мне помочь с этой проблемой?