SELECT column_name,column_type,IS_NULLABLE,column_key FROM information_schema.columns WHERE
table_schema= '数据库名' AND table_name = '表名'

博客给出了一条SQL语句,用于从information_schema.columns中查询指定数据库和表的字段信息,包括字段名、字段类型、是否可为空和字段键等。
SELECT column_name,column_type,IS_NULLABLE,column_key FROM information_schema.columns WHERE
table_schema= '数据库名' AND table_name = '表名'


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