• mysql 查询索引


    information_schema数据库是MySQL自带的,它提供了访问数据库元数据的方式。

    SELECT
        INDEX_SCHEMA,
        TABLE_NAME,
        index_name,
        group_concat(column_name order by seq_in_index) -- 列合并
    FROM
        information_schema.statistics -- 提供了关于表索引的信息。是show index from schemaname.tablename的结果取之此表。
    WHERE
        table_schema = 'test'
        AND table_name in (select
                              table_name
                           from information_schema.TABLES -- 提供了关于数据库中的表的信息(包括视图)。是show tables from schemaname的结果取之此表。
                           where TABLE_SCHEMA = 'test')
        and index_name like 'idx%'
    group by INDEX_SCHEMA , TABLE_NAME , INDEX_NAME

  • 相关阅读:
    Pandas获取本地csv文件到内存中
    波士顿房价数据集可视化
    tensorflow之数据集调用(波士顿房价数据集)
    查单词
    censoring
    字符串大师
    Parity game
    前缀和
    String
    Seek the Name, Seek the Fame
  • 原文地址:https://www.cnblogs.com/azterzmshan/p/4363392.html
Copyright © 2020-2023  润新知