I need to avoid duplicate entry from the table. The data come from another server as a parallel database connection. Which is directly inserted to my table but the fact is that I am getting a duplicate row in the same date so I need to avoid duplicate entry with trigger and my code is below:
BEGIN
IF(old.login_datetime==new.login_datetime) THEN DELETE FROM attlog WHERE emp_id=old.emp_id
END