我需要一个表定义,其中仅当 3 列相同时才考虑重复。
Accountid, Reportid, Date (Y-m-d)
1 2 2014-01-01
1 2 2014-01-02
2 2 2014-01-01
1 2 2014-01-01 //Dupe And not let it insert like a primary key
最佳答案
使用的解决方案
更改忽略表 MyTable 添加唯一键 my_unique_key_name (accountid、reportid、date)
– 米哈伊 1 月 29 日 19:19
关于mysql - 由多列定义的唯一行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21440472/