Oracle user_indexes转换为MySQL [英] Oracle user_indexes translation to MySQL

查看:197
本文介绍了Oracle user_indexes转换为MySQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有Oracle查询:

I have Oracle query:

SELECT index_name, table_name FROM user_indexes;

由于user_indexes是Oracle特定的视图,如何将其转换为MySQL?这是我的尝试:

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

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);

这两个SQL语句是否等效?

Are these two SQL statements are equivalent?

推荐答案

在Oracle user_indexes视图中,包含有关存储在当前连接的用户的架构中的索引的信息.

In Oracle user_indexes view contains informations about the indexes stored in the schema of the currently connected user.

与在Mysql SCHEMA = DB中一样,可以将您提出的选择视为等同于Oracle的user_indexes视图中的选择. 问候 乔娃

As in Mysql SCHEMA=DB, the select proposed by you can be considered equivalent to the select from Oracle's user_indexes view. Regards Giova

这篇关于Oracle user_indexes转换为MySQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆