最后编辑于2021-06
SELECT
DATE_ADD(t1.etta_depart_date,CAST(MIN(eag.aging_time)/24 AS BIGINT)) AS expect_arrive_time
FROM a表 t1
LEFT JOIN (
SELECT DISTINCT mileage_from,mileage_to,aging_time
FROM b表
) eag ON t1.etta_rate_mileage between eag.mileage_from and eag.mileage_to
报了SQL 错误 [1064] [42000]: errCode = 2, detailMessage = non-equal LEFT OUTER JOIN is not supported 错误,
请问一下这种left join on between有没有好的写法,他们之间只有区间的关系?
收藏
点赞
0
个赞
请登录后评论
TOP
切换版块
嗯,目前如果 Join 的条件不是等值条件 是不能 Left join ,Doris 确实还没支持。
SELECT
DATE_ADD(t1.etta_depart_date,CAST(MIN(eag.aging_time)/24 AS BIGINT)) AS expect_arrive_time
FROM a表 t1
LEFT JOIN (
SELECT DISTINCT mileage_from,mileage_to,aging_time
FROM b表
) eag ON t1.etta_rate_mileage between eag.mileage_from and eag.mileage_to
不好意思 sql重新整理一下发出来了
SELECT
DATE_ADD(t1.etta_depart_date,CAST(MIN(eag.aging_time)/24 AS BIGINT)) AS expect_arrive_time
FROM a表 t1
LEFT JOIN (
SELECT DISTINCT mileage_from,mileage_to,aging_time
FROM b表
) eag ON t1.etta_rate_mileage between eag.mileage_from and eag.mileage_to
很可能是因为你这里between and 写的是一个表中的列名,然后 doris 判定发现这里不是一个常量所以没支持
常量来的,就是取某个时间区间的时效就是某个常量。
这?你这么写的between and 的话?那 eag.mileage_from 这列的取值是??常量??还是一组数?