MySQL 命令集合
时间:2021-07-01 10:21:17
帮助过:22人阅读
CONCAT(
‘ALTER table ‘,t2.table_schema,
‘.‘,t2.table_name,
‘ CHANGE ‘,
‘ \`‘,t2.column_name,
‘\` \`‘,
UPPER(t2.column_name),
‘\` ‘,
t2.column_type,‘ ‘,
CASE WHEN t2.is_nullable
=‘NO‘ THEN ‘not null‘ ELSE ‘null‘ END,
‘ COMMENT ‘‘‘,t2.column_comment,
‘‘‘;‘)
AS c
FROM information_schema.tables t1, information_schema.columns t2
WHERE t1.table_schema
= ‘yourusername‘
AND t1.table_type
= ‘base table‘
AND t1.table_schema
= t2.table_schema
AND t1.table_name
= t2.table_name
MySQL 命令集合
标签:inf tables code upper name mat com div table