我有以下jpa / jpql查询:
select doiPoolName, (case when strpos(errormessage, 'Error exporting DOI') > 0 then 'Error exporting DOI' else errormessage end ) as errormes, count(*)
from DoiError doiError
where errortime >= to_timestamp('2015-01-06 10:45:00', 'YYYY-MM-DD HH24:MI:SS')
group by doiPoolName, errormes
order by errormes asc
将以下列形式在SQL中翻译:
select
doierror0_.doiPoolName as col_0_0_,
case
when strpos(errormessage, 'Error exporting DOI')>0 then 'Error exporting DOI' else errormessage
end as col_1_0_,
count(*) as col_2_0_
from
ERROR doierror0_
where
errortime>=to_timestamp(?, 'YYYY-MM-DD HH24:MI:SS')
group by
doierror0_.doiPoolName ,
errormes
order by
col_1_0_ asc
通过执行查询,我收到以下错误:
“错误:列”错误“不存在”
我很确定问题出在组,而不是 col_1_0 _ 有错误这意味着它不存在正确“翻译”......
有没有办法解决这个问题?