案例:
要写一个视图,类似"create or replace view as select 字段1,...字段50 from tablename" ,基表有50多个字段,要是靠手工写太麻烦了,有没有什么简便的方法?
应用wm_concat来让这个需求变简单。
SELECT 'create or replace view as select ' || wm_concat(column_name) ||
' from dept'
FROM user_tab_columns
WHERE table_name = 'DEPT';
' from dept'
FROM user_tab_columns
WHERE table_name = 'DEPT';