数据测试总结
问题:
mysql 语法 转 hql 语法过程遇到的问题:
- int 类型和 字符串类型比较大小 ,- 比如表中是int 类型 10 < '1' 或者 '10' > 1 ,常见与 where 后写法
 
- 类型转换问题  ; - sum( cast( case when channel_code='1' then ' ' else qty end as int ) ) ;
 
- 字符类型/null  和  Int 类型进行加减操作 ; - null +1 , ' 1 ' + 2 , ' '+ 1 ,
- case when true then qty end 缺少了 else 默认为null ,后续在进行计算时抛错
- coalesce(a.qty,b.qty) 缺少默认值
 
-  分母为0 的问题 ;- 1/sum(col)
- 1/col
- 1/cast( case when channel_code='1' then ' ' else qty end as int ) )
 
案例1:

案例2 :


 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号