【发布时间】:2023-03-05 09:56:01
【问题描述】:
我试图弄清楚如何在 django 中编写一个“不在”样式的查询。 例如,我正在考虑的查询结构如下所示。
select table1.*
from table1
where table1.id not in
(
select table2.key_to_table1
from table2
where table2.id = some_parm
)
假设模型名为 table1 和 table2,django 语法会是什么样子?
【问题讨论】: