dynamic-sql.sql 233 B

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