ORACLE 11203
为何第3个SQL查询不出数据,第4个SQL可以?
NCBI@portal>select table_name, index_name, index_type, uniqueness from user_indexes where uniqueness='UNIQUE' and index_name not like 'PK%';
TABLE_NAME INDEX_NAME INDEX_TYPE UNIQUENES
------------------------------ ------------------------------ --------------------------- ---------
ZHF_TYBB2JXC2KCQCAS IDX_JZHF_TYBB2JXC2KCQCAS_01 NORMAL UNIQUE
GL_BALANCE I_SNAP$_GL_BALANCE NORMAL UNIQUE
BD_CUMANDOC I_BD_CUMANDOC_JSZC_01 NORMAL UNIQUE
BD_INVCL I_BD_INVCL_2 NORMAL UNIQUE
Elapsed: 00:00:00.52
NCBI@portal>select a.table_name, a.index_name, a.index_type, uniqueness, b.index_name from user_indexes a, user_constraints b
2 where a.uniqueness='UNIQUE' and a.index_name not like 'PK%'
3 and a.table_name=b.table_name;
TABLE_NAME INDEX_NAME INDEX_TYPE UNIQUENES INDEX_NAME
------------------------------ ------------------------------ --------------------------- --------- ------------------------------
BD_INVCL I_BD_INVCL_2 NORMAL UNIQUE PK_BD_INVCL
BD_CUMANDOC I_BD_CUMANDOC_JSZC_01 NORMAL UNIQUE PK_BD_CUMANDOC
GL_BALANCE I_SNAP$_GL_BALANCE NORMAL UNIQUE
BD_INVCL I_BD_INVCL_2 NORMAL UNIQUE
BD_INVCL I_BD_INVCL_2 NORMAL UNIQUE
BD_INVCL I_BD_INVCL_2 NORMAL UNIQUE
BD_INVCL I_BD_INVCL_2 NORMAL UNIQUE
BD_CUMANDOC I_BD_CUMANDOC_JSZC_01 NORMAL UNIQUE
BD_CUMANDOC I_BD_CUMANDOC_JSZC_01 NORMAL UNIQUE
BD_CUMANDOC I_BD_CUMANDOC_JSZC_01 NORMAL UNIQUE
BD_CUMANDOC I_BD_CUMANDOC_JSZC_01 NORMAL UNIQUE
11 rows selected.
Elapsed: 00:00:02.22
NCBI@portal>select a.table_name, a.index_name, a.index_type, uniqueness, b.index_name from user_indexes a, user_constraints b
2 where a.uniqueness='UNIQUE' and a.index_name not like 'PK%'
3 and a.table_name=b.table_name
4 and a.index_name=b.index_name(+);
no rows selected
Elapsed: 00:00:02.11
NCBI@portal>NCBI@portal>select a.table_name, a.index_name, a.index_type, uniqueness, b.index_name from user_indexes a, user_constraints b
2 where a.uniqueness='UNIQUE' and a.index_name not like 'PK%'
3 and a.table_name=b.table_name(+)
4 and a.index_name=b.index_name(+);
TABLE_NAME INDEX_NAME INDEX_TYPE UNIQUENES INDEX_NAME
------------------------------ ------------------------------ --------------------------- --------- ------------------------------
GL_BALANCE I_SNAP$_GL_BALANCE NORMAL UNIQUE
BD_CUMANDOC I_BD_CUMANDOC_JSZC_01 NORMAL UNIQUE
ZHF_TYBB2JXC2KCQCAS IDX_JZHF_TYBB2JXC2KCQCAS_01 NORMAL UNIQUE
BD_INVCL I_BD_INVCL_2 NORMAL UNIQUE
Elapsed: 00:00:02.93
NCBI@portal>