Well, i have 4 tables, lets call them table1 table2 table3 and table4. In table1 i have a colum called "time" thats beeing updated with CURRENT_TIME on update´s.
So i currently got this procedure to delete old stuff from the database:
DELETE FROM `table1` WHERE `time` < (CURRENT_TIME() - INTERVAL 5 MINUTE);
This should delete all updates older than 5minutes in table1, now in table1, table2, table3 and table4 i got ID´s that matches eachother think of it as employee numbers, so how do i match them up from table1 so i can delete the employees from table2, table3 and table4 at the same time?
Also, its not completly 100% that the id exists in all 4 tables ofcourse, if this is important i dont know.
sidenote: Anyone knows WHEN procedures accually run? :P Thank you for your response! :)
EDIT: sorry, its mysql!