Oracle查询索引 :
select count(1) as search
from user_ind_columns,user_indexes
where user_ind_columns.index_name = user_indexes.index_name
and user_ind_columns.table_name = '表名';
查询字段:
select count(1) as dirdtime
from USER_TAB_COLUMNS
where upper(table_name)=upper('表名')AND COLUMN_NAME = '字段名称' (只能一次查询一个,如需查询多个请自行施展“Ctrl + c and Ctrl + v ”大法)
MySQL查询索引:
SELECT count(*) as a FROM information_schema.statistics
where table_name = '表名'
AND index_name = '索引名称'
查询字段:
select count(*) as a
from information_schema.columns
where table_name = '表名' and column_name = '字段名' (注意事项同Oracle)