表A:id,name,age
数据:1,'AA',18
表B:id,name,class
数据:2,'BB','3年2班'
怎么查询出结果
id,name
1,'AA'
2,'BB'
select id, name from A UNION all select id, name from B
select A.id,A.name,B.id,B.name from A,B where A.id=1 or B.id=2;
select id,name from 表A where id='1' union all select id,name from 表B where id='2'