1、MySQL
SHOW COLUMNS FROM 数据库名.表名;
2、PostgresSQL
SELECT
column_name, -- 字段名
data_type, -- 字段类型
is_nullable, -- 是否允许NULL
column_default -- 默认值
FROM
information_schema.columns
WHERE
table_name = 'eva_plan'
AND table_schema = 'public';
ORDER BY
ordinal_position; -- 按字段顺序排列
3、SQL Server
exec sp_columns '表名'
4、Oracle
SELECT
COLUMN_NAME,
DATA_TYPE,
NULLABLE
FROM
DBA_TAB_COLUMNS
WHERE
TABLE_NAME = '表名'
AND OWNER = '用户'
ORDER BY
COLUMN_ID;
1万+

被折叠的 条评论
为什么被折叠?



