我已经检查过了:如何在 sqlite 中使用 ROW_NUMBER
但这对我没有帮助。我已经这样查询了,它返回了错误的行索引。查询有什么问题?
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)