Redian新闻
>
foreign key reference to two tables? how to do it?
avatar
foreign key reference to two tables? how to do it?# Database - 数据库
m*r
1
Here, I got one foreign key data_id in table PLAN reference to two table
PROGRAM_TEXT(primary key data_id) and PROGRAM_MEDIA(primary key data_id)
how to write sql?
Create Table Plan
(
....
foreign key (Data_id) references PROGRAM_MEDIA(Data_id) ON DELETE CASCADE,
foreign key (Data_id) references PROGRAM_TEXT(Data_id) ON DELETE CASCADE
)
It doesn't work!!!!
pls help me
email: j*******[email protected]
avatar
m*r
2
Here, I got one foreign key data_id in table PLAN reference to two table
PROGRAM_TEXT(primary key data_id) and PROGRAM_MEDIA(primary key data_id)
how to write sql?
Create Table Plan
(
....
foreign key (Data_id) references PROGRAM_MEDIA(Data_id) ON DELETE CASCADE,
foreign key (Data_id) references PROGRAM_TEXT(Data_id) ON DELETE CASCADE
)
It doesn't work!!!!
pls help me
email: j*******[email protected]
avatar
n*a
3
Seems alright judging from your text.
What is your error message?

【在 m***r 的大作中提到】
: Here, I got one foreign key data_id in table PLAN reference to two table
: PROGRAM_TEXT(primary key data_id) and PROGRAM_MEDIA(primary key data_id)
: how to write sql?
: Create Table Plan
: (
: ....
: foreign key (Data_id) references PROGRAM_MEDIA(Data_id) ON DELETE CASCADE,
: foreign key (Data_id) references PROGRAM_TEXT(Data_id) ON DELETE CASCADE
: )
: It doesn't work!!!!

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。