set @pos := new.rating_score; set @qry1 := concat('update pro_item_revsum set score', @pos, '_cnt=score', @pos, '_cnt+1 where id = ', new.item_id ); prepare run_query from @qry1 ; execute run_query ;