简体   繁体   中英

Bulk Update in MYSQL

I have a site which has client side and admin side. There is a table called account History. which contains fields like uid | accountBalance | PaymentStatus | Date.

Now this table has to be updated every month for all the paid users and the table is bulk. So what is the best way to update the table every month.Do i need to select all the uid's and update.

UPDATE History
SET accountBalance=val1, PaymentStatus=val2, Date=val3,
WHERE PaymentStatus=true

I do not know what the values are, but it should look something like this :)

您可以使用类似以下查询的方法。

update history SET PaymentStatus="Paid" where accountBalance>00

you can create an windows service to call either an executable or to post data to a web page; add a timer inside your windows service and it acts exactly like a cron job.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM