MySQL删除包含NaN的记录

时间:2012-09-25 14:09:26

标签: mysql

我有一个带有“A”列的MySQL表,其中包含NaN值。你如何更新它们?我试过了

update myTable set A = 0 where A is NaN;

但它给了我一个语法错误。我如何查询NaN?

3 个答案:

答案 0 :(得分:1)

您应该能够使用以下其中一项:

update myTable 
set A = 0 
where A = 'NaN';

OR

update myTable 
set A = 0 
where A LIKE '%NaN%';

答案 1 :(得分:0)

尝试

 update myTable set A = 0 where A = 'NaN';

答案 2 :(得分:0)

尝试:

update myTable set A = '0' where A = 'NaN'