hibernate使用聚合函数SUM()
hibernate使用聚合函数SUM()为什么得到的是小数,不是整数Stringhql="selectSUM(artAnsowerNum)fromArticwhereen...
hibernate使用聚合函数SUM()为什么得到的是小数,不是整数
String hql = "select SUM(artAnsowerNum) from Artic where enterTime between ? and ? and project.prjId=?";
或String sql = "select SUM(art_ansower_num) from artic where enter_time between ? and ? and prj_id=?";
都是小数,如何能得到整数呢?
“ceiling,向上取整
floor是向下取整
round(a,0) 四舍五入 ”
他们都是hibernate里的吗?还是数据库的? 展开
String hql = "select SUM(artAnsowerNum) from Artic where enterTime between ? and ? and project.prjId=?";
或String sql = "select SUM(art_ansower_num) from artic where enter_time between ? and ? and prj_id=?";
都是小数,如何能得到整数呢?
“ceiling,向上取整
floor是向下取整
round(a,0) 四舍五入 ”
他们都是hibernate里的吗?还是数据库的? 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询