create table sum(
fee_id int(10) not null ,
resident_id int(10) not null ,
sum_content varchar(30) not null ,
sum_num varchar(15) not null ,
primary key (fee_id,resident_id),
foreign key (fee_id) references fee (fee_id),
foreign key (resident_id) references resident (resident_id)
)代码错误
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'sum(
fee_id int(10) not null ,
resident_id int(10) not null ,
sum_co' at line 1
fee_id int(10) not null ,
resident_id int(10) not null ,
sum_content varchar(30) not null ,
sum_num varchar(15) not null ,
primary key (fee_id,resident_id),
foreign key (fee_id) references fee (fee_id),
foreign key (resident_id) references resident (resident_id)
)代码错误
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'sum(
fee_id int(10) not null ,
resident_id int(10) not null ,
sum_co' at line 1
2.sum是关键字,需要用`sum`
3.仔细检查字段的数据类型等是否与该表中的一致