TA贡献1789条经验 获得超8个赞
with t1 as (select 1 from dual),
t2 as (select 2 from dual)
select * from t1, t2
TA贡献1806条经验 获得超5个赞
如果数据类型相似,可以使用as配合union来结合,例如select c1 as a,c2 as b,null as c from t1 unionselect cc1 as a,cc2 as b,cc3 as c from t2;其中,使用null来确保连个select有相同的列数.前提是两个select选择的同一列的数据类型相似.
10+年DBA老司机带你轻松玩转 SQL
¥ 48.00
举报