两条select数据
如下
view1:
name value1 value2 value3 value4
a1 11 12
a2 22 21
a6 54 55
a9 74 12
view2:
name value1 value2 value3 value4
a1 g1 g2
a2 j2 j1
a6 k4 i5
a7 d4 d6
我希望我最后得到的结果如下
name value1 value2 value3 value4
a1 11 12 g1 g2
a2 22 21 j2 j1
a6 54 55 k4 i5
a7 d4 d6
a9 74 12
join 下
select view1.name,view1.value1view1.value2,view2.value3,view2.value4 from view1 left join view2 on view1.name=view2.name
select view1.name,view1.value1,view1.value2,view2.value3,view2.value4 from view1 left join view2 on view1.name=view2.name union select view2.name,view1.value1,view1.value2,view2.value3,view2.value4 from view1 right join view2 on view1.name=view2.name