dourong9253 2014-11-18 04:41
浏览 256

多个外键可以指向MySql中的同一主键吗?

I have a table that logs a user's id and user's name. I want to create a second table that creates a group of different users such that the table columns look like: groupname, user1, user2, user3, user4, user5, user6. I want to reference the user columns (1-6) as a foreign key to the first table's user id column as a primary key. I am using phpMyAdmin on a local server. Can this be accomplished?

EDIT:

A user shouldn't be able to belong to multiple groups, and I was thinking I could set the referenced user columns as null until a user joins the group at which point the primary-key user_id would load into the referenced user_id columns.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 请问这个是什么意思?
    • ¥15 STM32驱动继电器
    • ¥15 Windows server update services
    • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
    • ¥15 模糊pid与pid仿真结果几乎一样
    • ¥15 java的GUI的运用
    • ¥15 我想付费需要AKM公司DSP开发资料及相关开发。
    • ¥15 怎么配置广告联盟瀑布流
    • ¥15 Rstudio 保存代码闪退
    • ¥20 win系统的PYQT程序生成的数据如何放入云服务器阿里云window版?