String counthql="select count(*) from (select distinct trainOrder.userid, trainOrder.course from TrainOrder trainOrder where trainOrder.course in (select course.courseId from KmsCourse course where course.knowledgeId='"+ knowledgeId + "')) as t";
请问这条语句哪里错了啊 在我网上找来好多都是一样的 到我这就报 :line 21 unexpected token:(
和line 87 unexpected token: from 这两个提示。
哪位遇到过啊。
请问这条语句哪里错了啊 在我网上找来好多都是一样的 到我这就报 :line 21 unexpected token:(
和line 87 unexpected token: from 这两个提示。
哪位遇到过啊。
select count(distinct trainOrder.userid)
from TrainOrder trainOrder
where trainOrder.course in
(select course.courseId
from KmsCourse course
where course.knowledgeId = '"+ knowledgeId + "')
SELECT COUNT(*) FROM TrainOrder trainOrder WHERE trainOrder.course.knowledgeId = ? GROUP BY trainOrder.userid试试这个吧....如果不对, 把你发的那个hql的每个属性的意思贴出来看看
trainOrderId courseId courseWareId userId
1 c_10 cw10 admin
2 c_10 cw11 admin
3 c_10 cw12 admin
4 c_10 cw13 admin
5 c_10 cw14 admin6 c_20 cw10 admin
7 c_20 cw11 admin
8 c_20 cw12 admin
9 c_20 cw20 admin
10 c_20 cw22 admin11 c_10 cw10 tset
12 c_10 cw11 tset
13 c_10 cw12 tset
14 c_10 cw13 tset
15 c_10 cw14 tset16 c_20 cw10 tset
17 c_20 cw11 tset
18 c_20 cw12 tset
19 c_20 cw20 tset
20 c_20 cw22 tset
我现在只想统计出 admin c_10 出现一次
admin c_20 出现一次
test c_10 出现一次
test c_20 出现一次
请问我的 String counthql="select count(*) from (select distinct trainOrder.userid, trainOrder.course from TrainOrder trainOrder where trainOrder.course in (select course.courseId from KmsCourse course where course.knowledgeId='"+ knowledgeId + "')) as t"; 不对吗?