我经过代码修改后,还是不行;页面中提示的错误是: t_hr is not mapped [select count(*) from t_hr where qMonth='08' and qYear='2014' GROUP BY deptCode] 已经精简到这样了。用debug生成的是这样的: select deptCode,deptCode from t_hr where qMonth='08' and qYear='2014' GROUP BY deptCode 在数据库中执行没问题啊 在myeclipse中执行的sql包含count()函数应该可以执行?(之前这样写的sql都没这种问题,求解)
你这样弄好了。 你先写一个最简单的sql,然后一句句加上去,看加到哪句就报错了。
t_hr is not mapped [select count(*) from t_hr where qMonth='08' and qYear='2014' GROUP BY deptCode]
已经精简到这样了。用debug生成的是这样的:
select deptCode,deptCode from t_hr where qMonth='08' and qYear='2014' GROUP BY deptCode
在数据库中执行没问题啊
在myeclipse中执行的sql包含count()函数应该可以执行?(之前这样写的sql都没这种问题,求解)
你是要计算分组之后的count。你那个sql感觉不对