我现在有三个表,表1:id,money,表2:id,name,表三:id,name
现在我想要结果集表1id,money,并且还要关联上name, 但是,表2和表3中name都不全,所以需要查询两次,所以需要用到union关联两个查询,
```
select a.id,a.money ,b.name as name from 表1 a left join 表2 b on a.id=b.id
union
select a.id,a.money,c.name as name from 表1 a left join 表3 c on a.id=c.id
```select a.id,a.money ,b.name as name from 表1 a left join 表2 b on a.id=b.id
union
select a.id,a.money,c.name as name from 表1 a left join 表3 c on a.id=c.id