常用SQL整理—Mysql

1、查看表字段、字段类型、表结构说明:

use information_schema;
select column_name,data_type,column_type,column_comment from information_schema.columns where table_schema ='@databaseName'  and table_name = '@tableName';

例:use information_schema;
select column_name,data_type,column_type,column_comment from information_schema.columns where table_schema ='acsdb'  and table_name = 'tbl_ai_alarm_info_20191011';

常用SQL整理—Mysql