What I have is a table with a bunch of products (books, in this case). My point-of-sale system generates me a report that has the ISBN (unique product number) and perpetual sales.
I basically need to do an update that matches the ISBN from one table with the ISBN from the other and then add the sales from the one table to the other.
This needs to be done for about 30,000 products.
Here is the SQL statement that I am using: UPDATE `inventory`,`sales` SET `inventory`.`numbersold` = `sales`.`numbersold` WHERE `inventory`.`isbn` = `sales`.`isbn`;
I am getting MySQL Error: #1317 SQLSTATE: 70100 (ER_QUERY_INTERRUPTED) Query execution was interrupted
I am using phpMyAdmin provided by GoDaddy.com
本文介绍了一种使用SQL更新大量产品销售数据的方法。具体而言,是从销售表中获取ISBN及对应的销量,并将其更新到库存表中对应产品的已售数量字段。由于涉及约30,000条记录,在执行过程中遇到了MySQL中断错误。
4565

被折叠的 条评论
为什么被折叠?



