I've already checked this: How to use ROW_NUMBER in sqlite
But it's not helpful for me. I've query like this & it returns me false row index. What's wrong with the query?
SELECT (select count(*) from medicalrecords b where a.id >= b.id ) as cnt,avg(bmi)
FROM MedicalRecords a
WHERE Date BETWEEN datetime('now', '-1 month') AND datetime('now', 'localtime')
group by strftime('%W', Date)