答案 0 :(得分:1)
尝试类似:
select month, day_of_week, sum(data), count(_id)
from table
group by month, day_of_week
答案 1 :(得分:1)
您可以在Android SQLite中使用普通的SQL语句
SELECT month, day_of_week, sum(data) AS total_data, count(month)AS number_of_rows_combined
FROM --table--
GROUP BY month, day_of_week
在Android中,您可以使用SQL作为:
Cursor c1 = db.rawQuery(
"SELECT month, day_of_week, sum(data) AS total_data, count(_id)AS number_of_rowa_combined
FROM --your table--
GROUP BY month, day_of_week",
new String[] {}
);