问题是这样的:我用powerDesigner设计的数据库,自动导出的sql语句建的表。其中有一个t_user表的一个字段n_dept_id,它是参考两个字段的,其中一个是t_dept的n_dept_id字段,另一个是t_out_dept的n_out_dept_id字段。mysql的语句如下:
alter table t_user add constraint FK_Reference_58 foreign key (n_dept_id)
references t_dept (n_dept_id) on delete restrict on update restrict;alter table t_user add constraint FK_Reference_85 foreign key (n_dept_id)
references t_out_dept (n_out_dept_id) on delete restrict on update restrict;问题来了:当我插入一个数据的时候,t_user表的字段n_dept_id只参考t_out_dept的n_out_dept_id字段,完全无视t_dept的n_dept_id字段。我用Mysql Front 的时候,看到索引那一列有主索引,还有FK_Reference_85 ,没有FK_Reference_58。
怎么回事呢?大神帮帮忙啊。我用的mysql版本是5.X α版的。
alter table t_user add constraint FK_Reference_58 foreign key (n_dept_id)
references t_dept (n_dept_id) on delete restrict on update restrict;alter table t_user add constraint FK_Reference_85 foreign key (n_dept_id)
references t_out_dept (n_out_dept_id) on delete restrict on update restrict;问题来了:当我插入一个数据的时候,t_user表的字段n_dept_id只参考t_out_dept的n_out_dept_id字段,完全无视t_dept的n_dept_id字段。我用Mysql Front 的时候,看到索引那一列有主索引,还有FK_Reference_85 ,没有FK_Reference_58。
怎么回事呢?大神帮帮忙啊。我用的mysql版本是5.X α版的。
解决方案 »
- 取不到值,请大家帮忙修改这条mysql语句。
- hash分区进而进行子分区问题
- 在mysql中输入错误的命令时,控制台会提示响铃,声音很大,如何关闭呢?
- mysql TO_DAYS函数的用法
- select * from betcnsite where check=0 order by id
- 请教:windows中设置odbc中几个DSN的区别
- 安装MY SQL遇见的问题??
- 在win2000下 mysql 可以安装两个吗?怎么装?
- C++用什么连接MySQL方便?
- mysql5.7 json字段过滤问题
- 有谁用过MySQL Workbench,有个小问题请教下
- mysql 语句 关于 符号 :=
'截至2011-05-18 20:33:21 用户结帖率0.00%当您的问题得到解答后请及时结贴.
http://topic.csdn.net/u/20090501/15/7548d251-aec2-4975-a9bf-ca09a5551ba5.html
http://topic.csdn.net/u/20100428/09/BC9E0908-F250-42A6-8765-B50A82FE186A.html
http://topic.csdn.net/u/20100626/09/f35a4763-4b59-49c3-8061-d48fdbc29561.html8、如何给分和结贴?
http://community.csdn.net/Help/HelpCenter.htm#结帖