SQL 查询在执行时遇到了“Unsupported JOIN ON conditions”错误
首先筛选出所有可能的连接候选行,然后在一个单独的查询中处理它们:
-- 假设我们只关心 lsq_66b072a2ef800.ajmc 大于 rsq_66b072a2ef803.dqczdw 的情况
WITH LeftFiltered AS (
SELECT *
FROM default.m_667bbfca10d68_all
WHERE EXISTS (
SELECT 1
FROM default.m_667be72f980a3_all
WHERE default.m_667bbfca10d68_all.ajmc > default.m_667be72f980a3_all.dqczdw
)
),
RightFiltered AS (
SELECT *
FROM default.m_667be72f980a3_all
WHERE EXISTS (
SELECT 1
FROM default.m_667bbfca10d68_all
WHERE default.m_667bbfca10d68_all.ajmc > default.m_667be72f980a3_all.dqczdw
)
)
SELECT *
FROM LeftFiltered
CROSS JOIN RightFiltered
WHERE LeftFiltered.ajmc > RightFiltered.dqczdw;
-- 这里可能需要更复杂的逻辑来确定如何匹配行