数据库学习笔记 --- SQL查询数据库中所有表中的字段名和字段类型

这里总结几个数据库的查询所有表字段名和字段类型的SQL语句:

Mysql database:

 

select COLUMN_NAME, DATA_TYPE from information_schema.COLUMNS where table_name = 


Oracle database:

select column_name, data_type from all_tab_columns  where  TABLE_NAME = 


SQLServer database

select column_name,data_type from information_schema.columns where table_name = 


Postgresql database

select column_name, data_type from information_schema.columns where table_name = 'ahnavi' ORDER BY ordinal_position;




你可能感兴趣的:(数据库)