Home  >  Article  >  Database  >  MYSQL把负数变为正数_MySQL

MYSQL把负数变为正数_MySQL

WBOY
WBOYOriginal
2016-06-01 13:44:515819browse

bitsCN.com

具体MYSQL语句为
update 表 set 字段=abs(字段);
例如zencart 格式为
update zen_products set products_price=abs(products_price);
就可以批量把价格负数的改成正数了

摘自 Shine的圣天堂-〃敏〃

bitsCN.com
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn