查询数据库表字段名和字段类型等信息


mysql

select * from information_schema.columns where table_name = '表名'  and TABLE_SCHEMA='数据库名'

sql server

select *  from information_schema.columns where table_name = '表名'  and TABLE_CATALOG='数据库名'

oracle

select * from user_tab_columns  where table_name = upper('表名')