<strong><span style="font-size:18px;">create table message(
id int not null auto_increment,
title varchar(30) not null,
content text not null,
primary key(id)
)charset=utf8;
create table comment(
comment_id int not null auto_increment,
id int not null,
comment_content text not null,
primary key(comment_id)
)charset=utf8;
select message.title,if(comment.comment_content is null,0,comment.comment_content) new_content
from message left join comment on message.id=comment.id;</span></strong>
sql语句if用法二
最新推荐文章于 2023-11-10 14:54:43 发布