WHCSRL 技术网

mysql 操作

统计字段

如果需要写word文档,统计表信息

select `COLUMN_NAME`,  data_type, 
case when character_maximum_length is not null then character_maximum_length when datetime_precision = 0 then 1 when numeric_scale > 0 then numeric_precision else numeric_precision + 1 end as width,
(case when IS_NULLABLE = 'YES' then 'Y' else 'N' end) as can_null, 
COLUMN_KEY, COLUMN_COMMENT  
from information_schema.`COLUMNS` 
where TABLE_SCHEMA = 'xfuzz' and table_name = 'engine_basic_info';
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
推荐阅读