create table have(
roomnb1 int not null,
brname1 char(20) not null,
id1 int not null,
viewtype char(20) not null,
primary key(roomnb1,brname1,id1,viewtype)
)engine=innodb;
alter table has
add constraint fk_has_room foreign key(roomnb1,brname1,id1)
references room(roomnb,brname,id),
add constraint fk_has_view foreign key(viewtype)
references view (viewtype);
我收到了错误:
表中不存在键列'roomnb1'
但那是怎么回事?