I already broke my head while I was thinking how it can be done. Need to make a query with a condition that compares with the id of the current table entry.
That is, something similar to:
DELETE
FROM table1
WHERE TIMESTAMPDIFF(MINUTE, Time_ADD, now()) >= (
SELECT del_time
FROM table2
WHERE table1.id = table2.id
)
A similar query produces an error indicating that the subquery issues multiple values if the table1 is not specified for the id or that the table1.id does not exist if the table1 name is specified
P.S. Sorry for my English, if I made a mistakes.
EDIT 1 For ex. CREATE Query might seen like:
CREATE TABLE table1(
id int identity(1,1),
some_value varchar(max),
Time_ADD datetime
)
CREATE TABLE table2(
id int,
del_time int
)
In table2 I have int value in minutes. After that time id int table1 must be deleted.