Create view for column information
mysql>
mysql> CREATE OR REPLACE VIEW COLUMNS_IN_INDEX
-> (INDEX_CREATOR, INDEX_NAME,
-> TABLE_CREATOR, TABLE_NAME, COLUMN_NAME,
-> COLUMN_SEQ, ORDERING) AS
-> SELECT UPPER(INDEX_SCHEMA), UPPER(INDEX_NAME),
-> UPPER(TABLE_SCHEMA), UPPER(TABLE_NAME),
-> UPPER(COLUMN_NAME), SEQ_IN_INDEX,
-> CASE
-> WHEN COLLATION = 'A' THEN 'ASCENDING'
-> WHEN COLLATION = 'D' THEN 'DESCENDING'
-> ELSE 'OTHER'
-> END
-> FROM INFORMATION_SCHEMA.STATISTICS;
Query OK, 0 rows affected (0.00 sec)
mysql>
mysql>
Related examples in the same category