【发布时间】:2013-03-27 09:31:52
【问题描述】:
我有以下结构的表
id -- auto increment
name -- unique
group -- integer
Primary key(name,group)
我不想添加具有相同名称和组值的元素。
(i.e ("test",1) and ("test",1) should not be inserted.... and
("test",1),("test",2) can be inserted).
如果不存在,我想插入一个值。我检查了Link。
使用上面的链接可以进行操作,但问题是它只检查名称作为键而不与组结合(即插入值(“test”,1)和(“test”,2 ) 没有发生)
我该怎么做。
【问题讨论】:
标签: mysql