如果我运行下面的查询,我会得到一个我无法转换为 Long 的对象列表
String queryString = "select sum(cat.varaible1), sum(cat.varaible2) from Enrollment as cat where cat.created >= :startDate and cat.created <= :endDate";
如果我删除 sum(cat.varaible2) 那么我会得到一个包含 long 值的列表。
String queryString = "select sum(cat.varaible1) from Cat as cat where cat.created >= :startDate and cat.created <= :endDate";
为什么会这样?请解释