MySQL查询唯一索引的语句。

select table_name,index_name, group_concat(column_name order by seq_in_index) as index_column
from
information_schema.statistics
where NON_UNIQUE =0

and table_schema = '库名'
and index_name <> 'PRIMARY' 
group by table_name,index_name
order by table_name;

 

posted @ 2022-06-07 15:18  je_ck  阅读(492)  评论(0)    收藏  举报