关联查询
select u.username,img.url from user u inner join images img on u.username = img.username;
多列约束(留言表leaMsg)
create table leaMsg(
uid int(11) auto_increment primary key not null comment '主键ID,唯一性',
comment_id int(11) not null comment '文章id',
user_id int(11) not null comment '用户id',
unique key comment_id (comment_id, user_id)
)engine=myisam default charset=utf8;
create table leaMsg1(
uid int(11) auto_increment primary key not null comment '主键ID,唯一性',
comment_id int(11) not null comment '文章id',
user_id int(11) not null comment '用户id',
unique key comment_id (comment_id)
)engine=myisam default charset=utf8;
© 2021.勤客保留所有权利. 备案号: 湘ICP备2021013947