Oracle 和 AWS Redshift 获取 数据库所有表名和列名的

Oracle

表名区分大小写。

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

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

 

 

AWS Redshift

select table_schema,table_name from information_schema.tables where table_name like '%xxx%'; 

SELECT distinct table_catalog,table_schema,table_name FROM information_schema.columns where column_name like '%xxxxxx%';

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

 

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

posted @ 2018-11-19 11:20  爱知菜  阅读(15)  评论(0编辑  收藏  举报