I have a trigger like this in MySQL:
DELIMITER $$
CREATE TRIGGER service_before_update BEFORE UPDATE ON service
FOR EACH ROW
BEGIN
IF NEW.seatCount < (?) THEN
SIGNAL SQLSTATE '12345';
END IF;
END$$
DELIMITER ;
instead of (?) I want previous value of "seatCount" is there any easy way or I should use something like this(ServiceNo is a PRI key):
(SELECT seatCount FROM service WHERE serviceNo = NEW.serviceNo LIMIT 1)