- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
尝试用这样的 OR 条件连接 2 个表:
FULL JOIN table1
ON (replace(split_part(table1.contract_award_number::text, ' '::text, 2), '-'::text, ''::text)) = table2.contract_award_id
OR (btrim(replace(table1.solicitation_number::text, '-'::text, ''::text))) = table2.solicitation_id
但是 Postgresql 向我咆哮:
FULL JOIN is only supported with merge-joinable or hash-joinable join conditions
什么给了?出于某种原因,如果我添加条件:
WHERE table1.solicitation_number::text ~~ '%%'::text
错误没有发生,但我怀疑这会破坏 FULL JOIN 结果。
感谢您的帮助。
最佳答案
应该可以使用以下查询模拟两个表之间的任何完全外部连接:
SELECT * FROM t1
LEFT JOIN t2 ON t1.id = t2.id
UNION ALL
SELECT * FROM t1
RIGHT JOIN t2 ON t1.id = t2.id
WHERE t1.id IS NULL
并集的前半部分获取第一个表的唯一记录,以及所有重叠的记录。 union 的后半部分只获取第二个表的特定记录。将此模式应用于您的查询会得到:
SELECT column1, column2, column3
FROM fpds_opportunities fpds
LEFT JOIN fbo_all_opportunity_detail fbo
ON replace(split_part(fbo.contract_award_number::text, ' '::text, 2),
'-'::text, ''::text) = fpds.contract_award_id OR
btrim(replace(fbo.solicitation_number::text, '-'::text, ''::text)) = fpds.solicitation_id
UNION ALL
SELECT column1, column2, column3
FROM fpds_opportunities fpds
RIGHT JOIN fbo_all_opportunity_detail fbo
ON replace(split_part(fbo.contract_award_number::text, ' '::text, 2),
'-'::text, ''::text) = fpds.contract_award_id OR
btrim(replace(fbo.solicitation_number::text, '-'::text, ''::text)) = fpds.solicitation_id
WHERE
fpds.contract_award_id IS NULL AND fdps.solicitation_id IS NULL;
关于postgresql - 为什么 PostgreSQL 抛出 "FULL JOIN is only supported with merge-joinable or hash-joinable join conditions",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47405732/
尝试用这样的 OR 条件连接 2 个表: FULL JOIN table1 ON (replace(split_part(table1.contract_award_number::text
我有以下功能: void threadProc(){ for (int i = 0; i < 5; ++i) { std::cout << "\n thread #" <<
关于 std::thread::joinable 的网站 cppreference 上有说明: Checks if the thread object identifies an active thr
关闭。这个问题需要更多focused .它目前不接受答案。 想改进这个问题吗? 更新问题,使其只关注一个问题 editing this post . 关闭 5 年前。 Improve this qu
std::mutex MTX; bool ExitThread = false; //This function is running in a separate thread //for const
根据 documentation ,有几种队列的实现。我感兴趣的是 JoinableQueue 和 PriorityQueue,因为我想要一个具有优先级的可连接队列。 看来我只能在低版本中获得其中一个
假设我有以下类(class) class A { public: A() { my_thread=std::thread(std::bind(&A::foo, th
自从我对程序进行了更改后我遇到了问题,这可能是由于线程本身调用了 joinable。在这种情况下到底发生了什么? 编辑:我做了一些调试,问题是 Joinable 方法。 std::mutex thre
在 std::thread 中,如果我调用 join() 并且线程不可连接,则会引发异常。 所以我这样做: if (thread.joinable()) thread.join(); 现在假设线程
当我尝试使用内部连接连接表时..它返回数据..但是当我使用完全外部连接连接 4 个表时我说 ERROR: FULL JOIN is only supported with merge-joinable
我是一名优秀的程序员,十分优秀!