SQL query to obtain a count of how many items have each possible value for a given column
1 2 3 4 | SELECT STRFTIME('%H', DATETIME(time, 'unixepoch', 'localtime')), COUNT(anotherField) FROM log GROUP BY STRFTIME('%H', DATETIME(time, 'unixepoch', 'localtime')); |
Note: I haven’t worked with SQLite. However, it supports GROUP BY and hence, this should work. source:http://st 继续>