Using GROUP BY to fetch rows from SQLiteDatabase and then render them using SimpleCursorAdapter
- by jgauffin
I want to display total amount of seconds that was spent each day on a project.
I want to use SQLiteDatabase to fetch rows using the query below and then use SimpleCursorAdapter to fill a ListView.
SELECT projectId, date, sum(endedAt-startedAt) as hours
FROM project_reports
WHERE startedAt >= 1270098000
AND endedAt <= 1272776399
GROUP BY date, projectId