多外键关联的TSQ语句怎么写,给点思路
create table A
(
Aid int not null primary key,
ABid int not null
)
create table B
(
Bid int not null primary key,
Bname varchar(8) not null
)
insert into A values(1,1)
insert into A values(2,2)
insert into B values(1,网求)
insert into B values(2,晚秋)
alter table A add Constraint A_B_FK
foreign key (ABid) references B(Bid)
insert into A values(3,(select Bid from B where Bname='晚秋'))