I want to create a trigger that checks the last value of a column. If it is the same, it shouldn't insert (well, or deletes that row) it.

All I got for now:

USE `database`;
DELIMITER $$
CREATE TRIGGER `checkrow` BEFORE INSERT ON `table6` FOR EACH ROW
if inserted.sha1(column1) == select sha1(column1) from table6 order by id desc limit 1 then
delete inserted.column1;
end if

Nothing else.