TO show indexes we use the following query,
show indexes from student;
+---------+------------+-----------------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |
+---------+------------+-----------------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| student | 0 | PRIMARY | 1 | ROLL_NO | A | 6 | NULL | NULL | | BTREE | | |
| student | 1 | stu_roll_no_age_index | 1 | ROLL_NO | A | 6 | NULL | NULL | | BTREE | | |
| student | 1 | stu_roll_no_age_index | 2 | AGE | A | 6 | NULL | NULL | YES | BTREE | | |
+---------+------------+-----------------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+--------------+
Now I am trying to select only Table from the above as follows,
select Table, Key_name, Column_name,Index_type from (show indexes from student);
I think I might be wrong but I am not getting how to reason it? Please tell me. And also , how do I get only specific columns from the result of such query.