Show indexes for a table with MySQL - Mysql Views : 311
Tagged in : Mysql
0 0
Send mail
MySQL has a SQL query "SHOW INDEX FROM" which returns the indexes from a table.This query is used to get a list of indexes and a list of primary keys for a table with MySQL.

Syntax:
SHOW INDEXES FROM table_name;

Show the primary keys

To just show the primary key for the table run this query:

SHOW INDEXES FROM table_name WHERE Key_name = "PRIMARY";

By Rekha, On - 2010-01-28



    Login to add Comments .