仅将一个项目与一个客户关联 [英] Assining one project to only one customer

查看:91
本文介绍了仅将一个项目与一个客户关联的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用表customer(Customerid)和project(Projectid)

我的要求是一个项目应该只有一个客户...

即,如果将project1分配给customer1,则不应再次将其分配...但是可以将project1分配给customer2,3,4....

项目contains(projectid,projectcode,projectdesc,projname)... projid是主键
客户contains(custid,custname,custtype)... custid是主键...

i am using tables customer(Customerid) and project(Projectid)

my req is one project should have only one customer...

i.e, if project1 is assigned to customer1 then it should not be assigned again...but project1 can be assigned to customer2,3,4....

project contains(projectid,projectcode,projectdesc,projname)...projid is primary key
customer contains(custid,custname,custtype)...custid is primarykey...

推荐答案

个人?我将在项目表中有一个客户字段.如果为null,则不分配;如果不为null,则分配给该客户.由于您不能在同一行的同一字段中放置两个值,因此不能将项目分配给多个客户...
Personally? I would have a customer field in the project table. If it is null, it isn''t assigned, if it is not null it is assigned to that customer. Since you can''t put two values in the same field of the same row, you can''t assign the project to more than one customer...


这篇关于仅将一个项目与一个客户关联的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆