before delete trigger mysql
DELIMITER $$
CREATE TRIGGER trigger_name
BEFORE DELETE
ON table_name FOR EACH ROW
BEGIN
-- statements
END$$
DELIMITER ;
Code language: SQL (Structured Query Language) (sql)
before delete trigger mysql
DELIMITER $$
CREATE TRIGGER trigger_name
BEFORE DELETE
ON table_name FOR EACH ROW
BEGIN
-- statements
END$$
DELIMITER ;
Code language: SQL (Structured Query Language) (sql)
mysql trigger to delete old data
SET GLdelimiter //
create event if not exists clean_old_records
on schedule every 1 week
do
begin
delete from your_table_name
where
Timestamp < date_sub(curdate(),interval 1 month) ;
end; //
delimiter ;OBAL event_scheduler = ON;
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us