//查询表结构
select t.column_name,t.column_comment,t.column_type,case t.column_key when 'pri' then 'yes' else 'no' end,
t.is_nullable,t.column_comment from information_schema.'columns' t where t.table_name = '表名'
本文提供了一段用于查询指定表结构的SQL语句,包括字段名称、注释、类型、是否为主键、是否允许为空及其它相关信息。通过该SQL语句可以快速了解表的详细结构。
//查询表结构
select t.column_name,t.column_comment,t.column_type,case t.column_key when 'pri' then 'yes' else 'no' end,
t.is_nullable,t.column_comment from information_schema.'columns' t where t.table_name = '表名'

被折叠的 条评论
为什么被折叠?