如何使一个表列其他表列名称别名?

时间:2018-02-15 12:15:28

标签: sql oracle pivot olap-cube

我有2张桌子。我需要选择第二个表第1列中的第一个表列。

定义:第二个表有2列,第一列显示我们必须从第一个表中选择哪些列(数字),第二列显示该列标题结果屏幕必须是什么。

为了创建虚拟表,我添加了SQL这个表。 enter image description here 第一表

select '1' as joinable_column_id ,'First_column_name' from dual
union all
select '2' as joinable_column_id,'Second_column_name' from dual
union all 
select '3' as joinable_column_id,'Third_column_name' from dual
union all
select '4' as joinable_column_id,'Fourth_column_name' from dual;

第二桌

select 'id', 'column_1','column_2','column_3','column_4','column_5','column_6','column_7','column_8','column_9' from dual
union all
select 'id', 'column_row_1','column_row_2','column_row_3','column_row_4','column_row_5','column_row_6','column_row_7','column_row_8','column_row_9' from dual;

Result screen

0 个答案:

没有答案