1.查询数据库信息Sql (2019-06-01)
-- 查询表
SELECT
table_name AS tableName,
ENGINE,
table_comment AS comments,
create_time AS createTime
FROM
information_schema.TABLES
WHERE
table_schema = ( SELECT DATABASE ( ));
-- 查询列
SELECT
column_name AS columnName,
data_type AS dataType,
column_comment AS comments,
column_key AS columnKey,
is_nullable AS isNullable,
column_type AS columnType,
character_octet_length AS characterOctetLength,
extra
FROM
information_schema.COLUMNS
WHERE
table_name = 'sy_user'
AND table_schema = ( SELECT DATABASE ( ) )
ORDER BY
ordinal_position;
最后选择用人人的代码生成器。暂停开发
网友评论