不同行-基于两个字段 [英] Distinct Row - Based on two fields
问题描述
有没有一种方法可以使表的重复项基于两个字段?
Is there a way to have a table definition that bases its Non-Duplication on two fields?
通过这个我有3列 gid,cid,价格
By this i have 3 columns gid, cid, price
条件:
- 1个
gid
只能有1个cid
- 可以有多个
cid
,只要有多个gid
并且不违反标准1
- There can only be 1
cid
for 1gid
- There can be multiple
cid
's as long as there are multiplegid
's and criteria 1 is not violated
如果可能的话,我基本上希望在表设计中有限制.不知道是否有可能我想问.
I basically want to have the restriction in the Table Design, if possible. Not sure if its possible just figured i would ask.
好的澄清一下,我也有两个索引,一个在gid
上,另一个在cid
上,我可以用两个索引来确定唯一性吗?该表基本上是一个Join表,因为所绘制的两个表之间具有1-Many关系,因为它们的对应关系对其ID是唯一的.
Ok a little clarification, i have two indexes as well, one on gid
and other is on cid
, can i have the two indexes determine Uniqueness? The table is basically a Join table since the two tables drawn in have a 1-Many relationship, in so far as their counterpart is unique to its id.
表/索引声明:
- gid {Numeric:Long}(主要:否,唯一性:否,忽略空值:否)[FK]
- cid {Numeric:Long}(主要:否,唯一性:否,忽略空值:否)[FK]
- 价格{Numeric:Single}
用法:
-
cid 1-很多女同志
- cid源自tblCat(作为PK)
- cid 1-Many gid
- cid is derived from tblCat (as the PK)
- gid源自tblGrp(作为PK)
推荐答案
在MS Access中创建多字段索引没有困难.您只需单击索引按钮(闪电),然后选择所需的内容即可.
There is no difficulty in creating multi-field indexes in MS Access. You can simply click the indexes button (lightning flash) and choose what you need.
这篇关于不同行-基于两个字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!