SQL错误1072不存在

时间:2016-05-08 14:46:43

标签: mysql sql ddl

   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'

但那是怎么回事?

0 个答案:

没有答案