CREATE EVENT myevent4
ON SCHEDULE EVERY '1' MINUTE
DO
UPDATE receipt r
inner join loan l
on l.l_app_file_id=r.r_app_file_id
SET delinquent = (
if r.receipt_on='Principal' AND r.receipt amount >= l.app_principal
THEN 1
ELSE 0
END
);
I have two tables loan and receipt, I am trying to create an event so that when column receipt_on (from receipt table) is ‘Principal’ and column receipt_amount(from receipt table) is greater than or equal to column app_principal (from loan table) then set column delinquent (from receipt table) to be 0 else 1.
However there seems to be an error in my event
try the following