在information_schema中查找多列索引

时间:2016-07-25 20:55:18

标签: mysql database information-schema

我的表中包含一个由三列组成的索引。

有没有办法可以在information_schema中找到它,或者它只显示三个单独的索引?

1 个答案:

答案 0 :(得分:0)

向Radek Postolowicz致信steering me正确的方向:

SELECT 
  table_name AS `Table`,
  index_name AS `Index`,
  GROUP_CONCAT(column_name ORDER BY seq_in_index) AS `Columns`
FROM information_schema.statistics 
WHERE table_schema = 'db' 
AND table_name='tbl' 
GROUP BY 1,2;
相关问题