工作中,编写xmlsql时需要查询全部字段,可以利用sql快速组装所有的列
查询所有的表名
select table_name,table_comment,auto_increment from information_schema.`TABLES` where table_schema = 'seata';
查询某个表的所有字段
select column_name,data_type,column_comment,column_key,extra,character_maximum_length,is_nullable,column_defaultfrom information_schema.columns where table_schema = 'seata' and table_name = 'users' ;
组装表的所有列
select GROUP_CONCAT("t.",column_name) totalfrom information_schema.columns where table_schema = 'seata' and table_name = 'users' and column_name not in ('id');
来源地址:https://blog.csdn.net/baidu_30829927/article/details/130670858