请教SQL修改一所有产品的数据

来源:百度知道 编辑:UC知道 时间:2024/06/10 09:27:45
数据表 ecs_goods MyISAM

字段 integral

搜索ecs_goods 所有产品 设置 integral 为 0
请问如何设置?
(目前ecs_goods 里的产品里 integral 有的是 0 有的不是,想统一为 0

麻烦了,自身分不多,见谅。

update ecs_goods set ntegral=0
ntegral是数值的话就是上面的
如果是文本类的下面
update ecs_goods set ntegral='0'

update ecs_goods set integral = 0
如果integral是number型的
update ecs_goods set integral = "0"

万一不为0的只有十几条,全部更新一次岂不是浪费。
update ecs_goods set integral ='0' where integral<>'0'