我正在使用最新版本的DBFLOW
库,我正在尝试将单列总和计算为countOfNewPosts
这是我的桌子:
public class CafeWebNewPostInformation extends BaseModel {
@PrimaryKey
@Column
public int id;
@Column
public int cafeWebServerId;
@Column
public int countOfNewPosts;
@Column
@ForeignKey(tableClass = AlachiqCafeWebs.class,
references = @ForeignKeyReference(columnName = "parentId", foreignKeyColumnName = "id"))
private int parentId;
@Column
public int lastSavedId;
@Column
public int lastRequestedId;
@Column
public int lastRetrievedId;
}
这是我从这个表中得到的代码:
CafeWebNewPostInformation countOfNewPost =
SQLite.select(
Method.sum(CafeWebNewPostInformation_Table.countOfNewPosts).as("count")
)
.from(CafeWebNewPostInformation.class).querySingle();
我没有收到任何错误,这是结果:
截屏:
发生了什么 count
,这个结果在哪里?