Mysql
 sql >> Database >  >> RDS >> Mysql

Come incrementare in SQL usando un trigger?

devi avere for each row

CREATE TRIGGER UpdateStats 
AFTER INSERT ON Restaurant 
FOR EACH ROW 
    UPDATE RestaurantStats SET TotalRestaurants = TotalRestaurants + 1 WHERE Cusine = NEW.cusine;