各种数据库查询表结构以及字段的sql

366 阅读1分钟

各种数据库查询表结构以及字段的sql

mysql

show tables; select * from information_schema.TABLES select * from information_schema.columns DESCRIBE P_CANARYDEPLOYMENT_APP_SERVICE

oracle

SELECT * from all_tables where owner = 'MQS' DESCRIBE table MQS_MZSRFX_RC select * from all_tab_columns where table_name = 'MQS_MZSRFX_RC' select * from user_tab_columns where table_name = 'MQS_MZSRFX_RC'; select * from user_col_comments;

pg

select * from pg_tables ; show CREATE CHECK_LOG select * from information_schema.tables select * from information_schema.columns where table_name = 'CHECK_LOG'

ck

show tables select * from system.columns where table='jdbc_table' select * from system.tables t where name ='jdbc_table'

sql-server

SELECT * from INFORMATION_SCHEMA.TABLES t SELECT * from INFORMATION_SCHEMA.COLUMNS c

db2

select * from SYSIBM.TABLES t select * from SYSIBM.COLUMNS c WHERE TABLE_NAME = 'TEST'