select
p.provinceName as name,
count(s.id) as 'byrs',
sum(if(s.employment is not null && s.employment<>'',
1,
0))+sum(if(s.graduate is not null && s.graduate<>'',
1,
0))+sum(if(s.studyAbroad is not null && s.studyAbroad<>'',
1,
0)) as 'jyrs',
CAST(( sum(if(s.employment is not null && s.employment<>'',
1,
0))+sum(if(s.graduate is not null && s.graduate<>'',
1,
0))+sum(if(s.studyAbroad is not null && s.studyAbroad<>'',
1,
0)))/count(s.id) as decimal(38,
3))*100 as 'jyl'
from
Student s
inner join
School c
on s.school_id=c.id
inner join
Dictionary_Province p
on c.province_id=p.id
where
s.isInside=0
and year(s.graduationTime)=2010
group by
p.provinceName
用mysql客户端可以查询,但是用hibernate查询的时候就保存!(老系统查询的时候就没有报错!)
hibernate 别名查询时保存[type.StringType] could not read column value from result set:
答案:1 悬赏:80 手机版
解决时间 2021-04-25 07:41
- 提问者网友:寂寞梧桐
- 2021-04-25 01:22
最佳答案
- 五星知识达人网友:山河有幸埋战骨
- 2021-04-25 02:52
光给这一小段代码是很难什么东东来的.
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯