mysql从某数据库某个表中查询字段名称及其数据类型

sql = """
select column_name, data_type from information_schema.`COLUMNS` 
where table_schema = '{database}' and table_name = '{table_name}' 
order by ordinal_position;
""".format(database=database, table_name=table_name)

从某数据库某个表中查询字段名称及其数据类型

原文地址:https://www.cnblogs.com/lovebkj/p/13073510.html