select
concat(
concat(column_name,
concat(‘=‘,
concat(concat(‘#{‘,column_name),‘}‘)
)
),‘,‘)
from information_schema.`COLUMNS` where table_schema=‘saas-export‘ and table_name=‘ss_company‘;select
concat(column_name,concat(‘=‘,concat(concat(‘#{‘,concat(column_name,‘}‘)),‘,‘)))
from information_schema.`COLUMNS` where table_schema=‘saas-export‘ and table_name=‘ss_company‘select column_name,data_type,column_comment from information_schema.COLUMNS where table_schema=‘saas-export‘ and table_name=‘ss_company‘
以上sql语句获得的结果如
id  varchar ID
name    varchar 公司名称
原文:https://blog.51cto.com/13859849/2399766