• 主页

  • 投资

  • IT

    🔥
  • 设计

  • 销售

  • 共99篇

    mysql数据库

关闭

返回栏目

关闭

返回mysql数据库栏目

60 - 原生查 - 列名修改 - select col_name as "列名"

作者:

贺及楼

成为作者

更新日期:2024-04-09 14:26:13

原生查 - 列名修改 - select col_name as _列名_
  1. SELECT COLUMN_NAME as '列名' ,DATA_TYPE as '字段类型' ,COLUMN_TYPE as '长度加类型' FROM information_schema.`COLUMNS` where TABLE_SCHEMA like '库名' and TABLE_NAME like '表名' ORDER BY ordinal_position;
  1. SELECT COLUMN_NAME as '列名' ,DATA_TYPE as '字段类型' ,COLUMN_TYPE as '长度加类型'
  2. FROM information_schema.`COLUMNS`
  3. where
  4. TABLE_SCHEMA like '库名'
  5. and
  6. TABLE_NAME like '表名'
  7. ORDER BY ordinal_position;

ORDER BY ordinal_position;按照表顺序排序