在实现某个功能的时候,需要使用MySql数据库获取某数据的所有的表名以及该表名的所有列名与列值。
select table_name from information_schema.tables where table_schema='数据库表名'
select ORDINAL_POSITION as Colorder,Column_Name as ColumnName,COLUMN_COMMENT as DeText
from information_schema.columns where table_schema = '数据库名称' and table_name = '表名'
order by ORDINAL_POSITION asc
原文:https://www.cnblogs.com/ZengJiaLin/p/11653915.html