Using GROUP BY to fetch rows from SQLiteDatabase and then render them using SimpleCursorAdapter
Posted
by jgauffin
on Stack Overflow
See other posts from Stack Overflow
or by jgauffin
Published on 2010-05-04T09:49:17Z
Indexed on
2010/05/05
7:48 UTC
Read the original article
Hit count: 240
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
© Stack Overflow or respective owner