I have a table that looks like this:
我有一个看起来像这样的表:
I want to create a trigger, which doesn't allow new inputs of (Dita AND Ora AND Salla) if they already exist in database as a group of values.
我想创建一个触发器,如果它们已作为一组值存在于数据库中,则不允许(Dita AND Ora AND Salla)的新输入。
To be more specific, if a record exists with Hane, 12:00, 621. Do not allow it to be inserted!
更具体地说,如果Hane,12:00,621存在记录,请不要插入!
1 个解决方案
#1
2
ALTER TABLE fiekorari
ADD UNIQUE INDEX duplli (Dita, Ora, Salla);
#1
2
ALTER TABLE fiekorari
ADD UNIQUE INDEX duplli (Dita, Ora, Salla);