1.mysql的包含数据库的tables和列的信息。下列语句是创建临时表,并将查询到的信息插入到临时表中。
CREATE temporary table dictionarttemp
SELECT
C.TABLE_CATALOG,
C.TABLE_SCHEMA,
C.TABLE_NAME,
C.COLUMN_NAME,
C.ORDINAL_POSITION,
C.COLUMN_DEFAULT,
C.IS_NULLABLE,
C.DATA_TYPE,
C.CHARACTER_MAXIMUM_LENGTH,
C.CHARACTER_OCTET_LENGTH,
C.NUMERIC_PRECISION,
C.NUMERIC_SCALE,
C.DATETIME_PRECISION,
C.CHARACTER_SET_NAME,
C.COLLATION_NAME,
C.COLUMN_TYPE,
C.COLUMN_KEY,
C.EXTRA,
C.PRIVILEGES,
C.COLUMN_COMMENT
FROM
information_schema.COLUMNS C
INNER JOIN
information_schema.TABLES T ON C.TABLE_SCHEMA = T.TABLE_SCHEMA
AND C.TABLE_NAME = T.TABLE_NAME
WHERE
T.TABLE_SCHEMA = '数据库表名';
SELECT * FROM dictionarttemp;
2.导出临时表的数据:利用Navicat 导出数据