Home >Database >Mysql Tutorial >mysql的外键与自增矛盾了

mysql的外键与自增矛盾了

WBOY
WBOYOriginal
2016-06-06 09:41:031260browse

自增mysql外键主键

问题很简单:table A中的属性aid是自增的主键;table B中的属性bid是自增的主键,引用A中的aid作为外键。那么,B中的aid如果设为自增,B中就有两个自增,是不行的;如果不设为自增,又与A中的aid自增矛盾。请问这个问题怎么解决?

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn