怎么把Oracle中两个select结果拼接在一起(横向拼接)

两个无关联条件的结果进行拼接

蝴蝶不菲
浏览 6758回答 2
2回答

拉丁的传说

with t1 as (select 1 from dual),    t2 as (select 2 from dual)select * from t1, t2

忽然笑

如果数据类型相似,可以使用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选择的同一列的数据类型相似.
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Oracle