比如
现在 select a,b,c from table1 union all select a,b,'0' from table2--'0'为补位,没这个参数
我现在要再查,就这样:
select t.a,t.b,t.c from (select a,b,c from table1 union all select a,b,'0' from table2) t.
可是这样会报错,该如何写?
现在 select a,b,c from table1 union all select a,b,'0' from table2--'0'为补位,没这个参数
我现在要再查,就这样:
select t.a,t.b,t.c from (select a,b,c from table1 union all select a,b,'0' from table2) t.
可是这样会报错,该如何写?
以后这样的问题给20就可以了;不然以后想问问题都没分了 :)
我的是8i。
select a,b,c from table1 union all select a,b,'0' from table2
select a,b,c from table1 union all select a,b,'0' as B from table2
都可以。是不是其他的问题啊?
select t.a,t.b,t.c from (select a,b,c from table1 union all (select a,b,'0' from table2)) t
-- -- --
a b c
a b 0SQL>
http://community.csdn.net/Expert/topic/4944/4944769.xml?temp=.2244684可以肯定的是,如果把union all改为union,你的sql无论在哪个版本上都可以成功执行