谁可以使用解释查看在下面的 sql 中将选择多少条记录:
explain select * from products
but expain is not for update and delete command.
In php, I want to update an table using a sql , I want to check weather this sql will update only row or many rows , if many rows affected , this sql is not allow to run for preventing the table misoperation.
so how can I know how many rows will this update sql affected before I execute it?
update products set products_model = 'hello' where products_id = '1'
运行查询
SELECT COUNT(id) AS will_affect_rows_count FROM products WHERE products_id = '1'
这将为您提供将受 UPDATE 查询影响的行数。
请问为什么这个表中的产品可以有重复的 products_id?
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)