0

我有一张包含测试结果的表格。
看起来像:

Test    | Result
Math    | Pass
Science | Fail
History | cancelled
French  | Absent

该表名为 table1。我想删除表中列结果的值不是的行"Pass""fail"

就像是:

Delete from table1
where result not in (Pass, Fail);

结果表如下所示:

Test    | Result
Math    | Pass
Science | Fail
4

2 回答 2

3

尝试这个:

DELETE FROM table1 WHERE result NOT IN ('Pass', 'Fail');
于 2013-05-14T18:48:18.753 回答
1

Pass您的示例通过在and周围添加引号对我有用Fail

delete from table1
where result not in ('Pass', 'Fail')
于 2013-05-14T18:53:37.073 回答