SQL 如何过滤掉与 where 子句冲突的特定行

SQL how to filter out a specific row with conflicting where clause

这应该是一个简单的问题,但由于某种原因我无法让它工作。我有一个 table 如下所示:

|Name|Attribute| 
----------------
|Foo |     1   |
|Foo |     2   |
|Foo |     3   |
|Bar |     1   |
|Bar |     2   |
|Bar |     3   |
|Yum |     1   |
|Yum |     2   |
|Yum |     3   |

我想像下面这样过滤

|Name|Attribute| 
----------------
|Foo |     2   |
|Foo |     3   |
|Bar |     1   |
|Bar |     2   |
|Bar |     3   |

请注意,我已经删除了所有 "Yum" 并仅在 Attribute = 1

时删除了一个 "Foo"

问题是当我做这样的事情时

SELECT * 
FROM table
WHERE name in ('Foo', 'Bar')
AND (name != 'Foo' AND attribute != 1)

我得到这个结果

|Name|Attribute| 
----------------
|Bar |     2   |
|Bar |     3   |

我还以为括号把东西放在一起了?

我认为 or:

where (name = 'Bar') or (name = 'Foo' and attribute <> 1)
Select 
   * 
From 
   table
Where
   (Name <> 'Yum') and 
   not (Name = 'Foo' and attribute = 1)