请教个sql如何实现
存在表 a
col
1
2
3
表 b
col2
a
b
c
请问如何得到结果
col1 col2
1 a
1 b
1 c
2 a
2 b
2 c
3 a
3 b
3 c
------解决方案--------------------full join
------解决方案--------------------with t1 as
(
select 1 c1 from dual
union all
select 2 c1 from dual
union all
select 3 c1 from dual
),t2 as
(
select 'a' c2 from dual
union all
select 'b' c2 from dual
union all
select 'c' c2 from dual
)
select c1,c2
from t1,t2
order by c1
------解决方案--------------------select * from sdl_col1_test t1 full join sdl_col2_test t2 on t1.col1<>t2.col2;
------解决方案--------------------select * from a,b