Quantcast
Channel: CodeSection,代码区,数据库(综合) - CodeSec
Viewing all articles
Browse latest Browse all 6262

SQL查询数据库中所有表中的字段名和字段类型

$
0
0

这里总结几个数据库的查询所有表字段名和字段类型的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;


Viewing all articles
Browse latest Browse all 6262

Trending Articles