以前にストアド プロシージャを作成したことがありません。キーを共有するテーブル B のレコード数の結果でテーブル A のフィールドを更新するにはどうすればよいですか?
Table A is a "users" table with a Primary key "userid" and a field "rentals_count". Table B is a "rentals" table with a Foreign Key "userid"
For each user (record) in Table A update the "rentals_count" field with the sum of rentals in Table B that match that user as an integer.
The question includes the mechanics of actually implementing and running the stored procedure on a nightly basis.