like 和 instr的查询效率 select name from user where instr(id, 99)> 0; 等价于select name from user where id like %99%;
LIKE查询一次,就走一次全表扫描,效率非常慢
同样的效果,现在来换做INSTR函数来执行,时间上…
1、创建
create table USER
(ID NUMBER(20) not null,constraint PK_USER primary key (ID) //主键
);//添加注释
comment on table USER is 人员信息表;
comment on column USER.ID is 人员ID;
2、备份表
create table USER_temp as select * from USER;
--只取表结构…
1、修改字段
--修改字段名
alter table [表名] rename column oldCname to newCName;
--修改数据类型
alter table [表名] modify (columnName 数据类型);
2、删除字段
alter table [表名] drop column [字段名]
1、创建索引
create index 索引名 on 表名(列名);
2、删除索引
drop index 索引名;
3、创建组合索引
create index 索引名 on 表名(列名1,,列名2);
4、查询索引
--根据索引名,查询表索引字段
select * from user_ind_columns where index_name索引名;
--根据…
varchar2最大是4000字节,那么就看你的oracle字符集:(select userenv(‘language’) from dual;) 如果字符集是16位编码的,ZHS16GBK,那么每个字符16位,2字节,所以可以容纳2000字符。…