SELECT 'SELECT ' || listagg(column_name, ',') within GROUP(ORDER BY t.column_id) over() || ' FROM ' || t.owner || '.' || t.table_name v_list
FROM dba_tab_columns t
WHERE t.owner = 'SCOTT'
AND t.table_name = 'EMP'
select col1 from
(
select 'select '||
listag(column_name, ',') with group(order by colunm_id) over(partition by table_name)
||' from ’||table_name col1,
row_number() over (partition by table_name order by column_id) col2
from user_table_columns
)
where col2 =1