小编tan*_*ler的帖子

为什么这个sql使用union all都没有返回数据

sql 1st的结果:

select p1.t1, p2.t2, p2.t3 from 
(select 'A' as t1,'' as t2,'' as t3 from dual ) p1 left join
(select '' as t1, '' as t2, '' as t3 from dual where 1=2) p2 on p1.t1 = p2.t1
Run Code Online (Sandbox Code Playgroud)

A   NULL    NULL
Run Code Online (Sandbox Code Playgroud)

sql第2的结果:

select p1.t1, p2.t2, p2.t3 from 
(select 'B' as t1,'' as t2,'' as t3 from dual ) p1 left join
(select '' as t1, '' as t2, '' as t3 from dual where 1=2) p2 on …
Run Code Online (Sandbox Code Playgroud)

sql oracle union

7
推荐指数
1
解决办法
556
查看次数

标签 统计

oracle ×1

sql ×1

union ×1