如何从sql数据库中获取字段名称类型

Ric*_*ard 5 mysql

要获取字段名称,可以使用以下命令:

select column_name from information_schema.columns where table_name='person'; 
Run Code Online (Sandbox Code Playgroud)

我的问题是如何在类似的列表中获得字段类型?

Ben*_*n S 13

SELECT
    column_name,
    column_type    # or data_type 
FROM information_schema.columns 
WHERE table_name='person'; 

架构信息