我有一张有测试结果的表格 它看起来像:
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
答案 0 :(得分:3)
试试这个:
DELETE FROM table1 WHERE result NOT IN ('Pass', 'Fail');
答案 1 :(得分:1)
您的示例通过在Pass
和Fail
周围添加引号为我工作。
delete from table1
where result not in ('Pass', 'Fail')