我现在有两个视图,分别为:
A:
NAME SCORE 
a     5
b     6B:
NAME 
 c     
 d现在想在一个视图中纵向合并两个视图,合并后原来B中数据的score都为0,或者null也可以吧,当然最好是0。也就是结果是:
C:
NAME SCORE
a    5
b    6
c    0请问可以做到吗?如果可以,应该怎么做?

解决方案 »

  1.   

    SELECT * FROM A
    UNION ALL
    SELECT NAME,0 FROM B?
      

  2.   

    怎么没有D
    select * from a
    union all
    select name ,0 from b
      

  3.   

    select * from A
    union all
    select name,0 from B
      

  4.   

    select a.name , a.score from a
    union all
    select b.name , 0 score from b
      

  5.   

    select * from a
    union all
    select name ,0 as socre from b
      

  6.   

    select * from a
    union all
    select name ,0 as socre from b