select mon from prepare where cast( “201812” AS int) - 6 < cast(mon as int) < cast( “201812” AS int) ;
本以为出现是201807-201811结果出现是201807-201812
后来改为
select mon from prepare where cast( “201812” AS int) - 6 < cast(mon as int) and cast(mon as int)< cast( “201812” AS int) ;
结果出现是201807-201812
可见hive不能 cast( “201812” AS int) - 6 < cast(mon as int) < cast( “201812” AS int) 这样写相当右边不识别
hive遇到坑之一数字比较大小
最新推荐文章于 2024-06-28 15:45:17 发布