如何从字段等于 header 的 table 中删除记录?
How to delete record from table where field is equal to header?
我有一个 sqlite table,其中包含我想删除的重复项 headers。这是我目前的声明。
DELETE FROM table WHERE FIELD = "FIELD"
此语句在执行时会删除整个 table。
不要对字符串使用双引号!
delete from table where field = 'field';
字符串分隔符的 SQL 标准是单引号。有时使用双引号,但它们也用作列名的转义字符。所以你的代码只是 where field = field
并且删除了所有非 NULL 值。
我有一个 sqlite table,其中包含我想删除的重复项 headers。这是我目前的声明。
DELETE FROM table WHERE FIELD = "FIELD"
此语句在执行时会删除整个 table。
不要对字符串使用双引号!
delete from table where field = 'field';
字符串分隔符的 SQL 标准是单引号。有时使用双引号,但它们也用作列名的转义字符。所以你的代码只是 where field = field
并且删除了所有非 NULL 值。