Oracle user_indexes translation to MySQL

I have an Oracle query:

SELECT index_name, table_name FROM user_indexes; 

Since user_indexes is an Oracle specific view, how can I translate it to MySQL? This is my attempt:

 DECLARE currrentDB VARCHAR(64); SELECT DATABASE() INTO currrentDB; SELECT INDEX_NAME, TABLE_NAME FROM information_schema.statistics s WHERE UPPER(s.TABLE_SCHEMA) = UPPER(currrentDB); 

Are these two SQL statements equivalent?

+2
source share
1 answer

The Oracle view user_indexes contains information about indexes stored in the current user schema.

As in Mysql SCHEMA = DB, the selection you proposed can be considered equivalent to choosing Oracle user_indexes from the Oracle view. Regards Giova

+1
source

All Articles