Clickhouse 查询时报错 No operation greater between Decimal

阅读 65

2022-01-27

No operation greater between Decimal

Clickhouse 查询时报错

原因是xxx字段是Decimal类型,只支持int型条件,不支持小数形式的条件 如:

select * from table01 where xxx>0;select * from table01 where xxx>1 ; 正常
select * from table01 where xxx>0.1; 就会报错

解决方案:
可以把xxx字段换为float
1.把表字段类型换成float(建议)
2.如表类型不方便修改,可以在查询时使用toFloat64(xxx) ,把字段装换为Float类型 如下:

select * from table01 where toFloat64(xxx)>0.1;

精彩评论(0)

0 0 举报