Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
v3.0.0
-
None
Description
问题1: 使用 sum case when 的时候,数据类型转换报错:
SQL:" select unit_code, sum(case when task_type='11' then amount else 0 end ) amount1, sum(case when task_type='12' then amount else 0 end ) amount2 from im_tasks group by unit_code"
amount 是double类型,sum(amount)也是double,在查询时报错:
java.math.BigDecimal cannot be cast to java.lang.Double while executing SQL
问题2:加了强制转换类型,执行后超时了:
SQL:" select unit_code, sum(case when task_type='11' then amount else cast('0.0' as double) end ) amount1, sum(case when task_type='12' then amount else cast('0.0' as double) end ) amount2 from im_tasks group by unit_code"
在查询时报错:
Coprocessor passed deadline! Maybe server is overloaded as ……