哪一个在Linux上更好?Valgrind或Purify您对使用它们有何看法?
我需要在下面的两个表A和B上进行双外连接,以使用SQLAlchemy ORM或SQL表达式获得呈现结果.
表B应该是外部连接两次,以便连接两个结果集(由c_id区分),这些结果集用于相同的A记录.外连接用于获取NULL,其中在第一个(c_id = 66)或第二个(c_id = 70)外连接中缺少B结果.
一张桌子:
id
--
1
2
3
4
Run Code Online (Sandbox Code Playgroud)
B表:
id | a_id | c_id
---+------+------
1 | 1 | 66
2 | 2 | 66
3 | 3 | 70
4 | 4 | 66
5 | 4 | 70
Run Code Online (Sandbox Code Playgroud)
查询结果应为:
a_id | b1_id (66) | b2_id (70)
-----+------------+-----------
1 | 1 | NULL
2 | 2 | NULL
3 | NULL | 3
4 | 4 | 5
Run Code Online (Sandbox Code Playgroud)
我到了正确的原始SQL查询如下所示:
SELECT
A.id AS a_id, …
Run Code Online (Sandbox Code Playgroud)