使用一条sql语句查询这两个表的分数相同的人的名字(使用联合查询)
create table a(
id int(10),
score int(3),
name varchar(20),
)charset utf8;
create table b(
id int(10),
score int(3),
name varchar(20)
)charset utf8;
(select name from a where score=99 order by id desc limit 0,10)
union all
(select name from b where score=99 order by id desc limit 0,10);
* 要注意的是a表要与b表字段数要相同