数据库流 'count as'

DBFlow 'count as'

我想在DBFlow中执行以下语句:

SELECT SECTION_ID, COUNT(SECTION_ID) AS SECTION_COUNT FROM ARTICLES GROUP BY SECTION_ID ORDER BY SECTION_COUNT DESC

我试过的是:

Select(Article_Table.sectionId).from(Article.java).count(???) ...

Flow object has a count()method but it takes a DatabaseWrapper as an argument which I frankly don't understand, I would have expected it to take a Table Column (i.e. Property)。

有什么办法可以做到这一点吗?

您需要添加

Method.count() 

在您的 Select() 声明中

示例:Select(Method.count()).from(Article.class).count();