mysqlイベント内でselectを実行してから、そのselectからのデータで別のテーブルを更新しようとしています。しかし、それは機能していないようです。
私がやっている:
BEGIN
select read_pub_id, read_artc_id, count(read_artc_id) as times_read from reads_t GROUP BY read_pub_id, read_artc_id;
update reads_totals set read_total = times_read where pub_id = read_pub_id and artc_id = read_artc_id;
update reads_totals set ts=now(); /*This is for testing*/
END
tsのみが更新されます。これは、イベントが機能していることを意味します。
ここに追加するwhileループはありますか?また、その方法は?これを行う正しい方法は何ですか?
これに関する私の以前の質問はここにあります: