Search
 
SCRIPT & CODE EXAMPLE
 

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;
Comment

PREVIOUS NEXT
Code Example
Sql :: install sql server in ubuntu 20.04 
Sql :: oracle sql procedure return value 
Sql :: trigger sql server 
Sql :: sql is null or empty 
Sql :: sql not 
Sql :: how to insert multiple rows in mysql using laravel 
Sql :: index in mysql 
Sql :: sql stored procedure output parameters 
Sql :: Should I use the datetime or timestamp data type in MySQL? 
Sql :: connect mysql 
Sql :: insert to first table if field A equals field B from a second table using sql 
Sql :: stuff and replace in sql 
Sql :: postgres insert 
Sql :: sql select distinct 
Sql :: SQLSTATE[42S02]: Base table or view not found: 1146 Tabl 
Sql :: select from table and insert into table in sql 
Sql :: sqllite format 
Sql :: UPDATE SQL RAHULDEV 
Sql :: how to use 3 fields as primary key in sql tables? 
Sql :: sqlalchemy datetime utcnow 
Sql :: mysql group by derived column 
Sql :: contraint default SQL 
Sql :: select all fron table 
Sql :: insert statement with $1 
Sql :: sql multiple into 
Sql :: second highest salary in mysql 
Sql :: update top 100 order by sql server 
Sql :: query for backup a database at another location in file system 
Sql :: mysql workbench copy table structure 
Sql :: mysql pv progres 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =