我从 SQLite 查询中得到了一个奇怪的结果。查询是下一个:
SELECT rule FROM rules
WHERE idRule = (SELECT idRuleForeign FROM rulesXfilter
WHERE idFilterForeign = (SELECT idFilter FROM filters
WHERE name = 'Filter1'));
现在,假设我有以下表格,上面有几行。
filters rules rulesXfilter
idFilter name idRule rule idRuleForeign idFilterForeign
1 Filter1 1 Rule1 1 1
2 Filter2 2 Rule2 2 1
3 Rule3 3 1
2 2
我得到的是 {Rule1},虽然我认为我应该得到 {Rule1, Rule2, Rule3}
我究竟做错了什么?