add a UNIQUE for columns,
ALTER TABLE TableName ADD CONSTRAINT tb_uq UNIQUE (ID, LastName)
after it has been implemented, if you try to insert a value that already has an identifier and LastName, it throws an exception. Example
INSERT INTO tableName (ID, LASTNAME) VALUES (1, 'hello') // ok INSERT INTO tableName (ID, LASTNAME) VALUES (2, 'hello') // ok INSERT INTO tableName (ID, LASTNAME) VALUES (1, 'hello') // failed
source share