1. 程式人生 > >Oracle 和 AWS Redshift 獲取 資料庫所有表名和列名的

Oracle 和 AWS Redshift 獲取 資料庫所有表名和列名的

Oracle

select table_name from user_tables where table_name like '%plnsm%';

select OWNER, TABLE_NAME, COLUMN_NAME from all_tab_columns where COLUMN_NAME LIKE '%plng_sum_cd%';

 

 

AWS Redshift

select distinct(tablename) from pg_table_def where tablename like '%pln%'; 

SELECT distinct table_name FROM information_schema.columns where column_name like '%plng_sum_cd%';

SELECT * FROM information_schema.columns where table_name like '%slsm_plnsm_lk%';

 

https://docs.aws.amazon.com/redshift/latest/dg/t_querying_redshift_system_tables.html