Request

SHOW INDEX FROM `table_name` WHERE KEY_NAME = 'index_name' 

returns the table. Why can't I display the number of rows in this table with the following query?

 SELECT COUNT(*) FROM (SHOW INDEX FROM `table_name` WHERE KEY_NAME = 'index_name'); 

Is this a wrong query, or is it basically impossible to print the number of rows in a table - the result of a SHOW INDEX query?

  • SHOW is not a DML (data management) operator and cannot be used in queries - Mike
  • @Mike, and there is no such command in order to show whether there is an index in the table, and is a DML operator, in MySQL? - Ksenia
  • Probably the only request is an appeal to the database information_schema? ... - Ksenia
  • Yes, just by calling information_schema - Mike

0