1.查询表结构
select
ordinal_position "序号",
column_name "字段",
column_type "字段类型",
column_key "约束",
is_nullable "可空",
column_default "默认值",
extra "自增性",
column_comment "注释"
from
(
select
t1.table_name,
t1.table_comment,
t2.ordinal_position,
t2.column_name,
t2.column_type,
t2.column_key,
t2.extra,
t2.is_nullable,
t2.column_default,
t2.column_comment
from
information_schema.tables t1
left join information_schema.columns t2
on
t1.table_name = t2.table_name
where
t1.table_schema = 'sjsg'
order by
t1.table_name,
t2.ordinal_position) t
where table_name='B_RS_DW'
标签:comment,常用,name,column,t2,查询,mysql,table,t1
From: https://www.cnblogs.com/fuguanghe/p/17967897