案例:

要写一个视图,类似"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';

 

相关文章:

  • 2022-01-25
  • 2023-03-14
  • 2021-12-22
  • 2021-09-23
  • 2022-01-02
  • 2022-12-23
  • 2021-12-24
  • 2022-12-23
猜你喜欢
  • 2022-02-07
  • 2022-12-23
  • 2021-11-18
  • 2022-12-23
  • 2021-09-06
  • 2022-02-06
  • 2021-06-27
相关资源
相似解决方案