Is it possible to alter a table so that the row as a whole (excluding the IDENTIFIER (ID) ) can only be inserted once in the database? For example; you have a Start and End timestamp for an Employee, and you want other employees to be able to have the same Start and End value, but you don't want the same Employee to be able to inserted twice the same Start and End value?
1 Answer
You can define a unique constraint or index for the rest of the rowsin the column:
alter table t add constraint t_unique_all unique (employee, start, end)