Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个包含以下字段的表:
id | listrate | retailrate 1 | .10 | .12
目前零售率为12%。我需要一个 mysql 查询,它将所有零售率更新为 40%,基本上是一个针对每条记录 listrate * 1.4 的查询。我需要你的帮助!
假设您的表名为tableName,如果您需要将 设置retailrate为 40%,则 SQL 查询将是:
tableName
retailrate
UPDATE tableName SET retailrate = .40
如果您需要增加retailrate 40 % :
UPDATE tableName SET retailrate = retailrate * 1.4