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.
更新数据后是否可以获得受影响的行数?
这里有一个例子:
count = table_products.where(:status => 1).update(:status => 0) # is sth like this possible?
你试过了吗?文档说这update实际上返回了受影响的行数:
update
返回值通常是更新的行数,但这取决于适配器。
我没有 MySQL 来检查它是否真的有效,但如果没有,我想这取决于 MySQL,而不是 Sequel。