select * from 表1 as a left join 表2 as b on a.xh = b.xh
union all?
select * from A
UNION ALL
select * from B
//查询的A和B的字段要相同
也可以 用 left join 左关联
select*from(
select*from A a
left join
select*from B b
on a.name=b.name
where .....)
SELECT *
FROM A
JOIN B ON 1=1
左右关联条件默认1=1全部关联,是这个意思吧。没有条件