oracle instr
对于instr函数,我们经常这样使用:从一个字符串中查找指定子串的位置。例
如:
SQL> select
instr('yuechaotianyuechao','ao') position from dual;
POSITION
----------
6
从字符串'yuechaotianyuechao'的第一个位置开始,向后查找第一个出现子串'ao'出现的位置。
其实instr共有4个参数,格式为“instr(string, substring, position,
occurrence)”。可实现子串的如下搜索:
1.从指定位置开始搜索子串
2.指定搜索第几次出现的子串的位置
3.从后向前搜索
--1.从第7个字符开始搜索
SQL> select
instr('yuechaotianyuechao','ao', 7) position from dual;
POSITION
----------
17
--2.从第1个字符开始,搜索第2次出现子串的位置
SQL> select
instr('yuechaotianyuechao','ao', 1, 2) position from dual;
POSITION
----------
17
--3.从倒数第1个字符开始,搜索第1次出现子串的位置
SQL> select
instr('yuechaotianyuechao','ao', -1, 1) position from dual;
POSITION
----------
17
--3.从倒数第1个字符开始,搜索第2次出现子串的位置
SQL> select
instr('yuechaotianyuechao','ao', -1, 2) position from dual;
POSITION
----------
6
相关文档:
对于 Oracle 的 rownum 问题,很多资料都说不支持>,>=,=,between...and,只能用以上符号(<、<=、!=),并非说用>,>=,=,between..and 时会提示SQL语法错误,而是经常是查不出一条记录来,还会出现似乎是莫名其妙的结果来,其实您只要理解好了这个 rownum 伪列的意义就不应该感到惊奇,同样是伪列,rownum ......
There are lots of problems with Oracle DATE & TIMESTAMP and their
counterpart Java classes since they do not directly compare. DATE fields
in Oracle will give date & time where a ......
权限管理
Oracle 9i
3个默认用户
sys(超级管理员) 默认密码:change_on_install
system(普通管理员)
默认密码:manager
scott(普通用户) 默认密码:tiger
Oracle 10g
sys(密码在安装时设置)
system(密码在安装时设置)
scott(默认锁定,想用得解锁)
启动Windo ......
表task,字段id_,name_
id_的数据如下形式:
1
1.1
1.1.1
1.1.1.2
1.2
1.2.1
...
10
10.1
10.1.1
10.2.1
10.2.1.1
10.2.1.1.1
10.2.1.1.2
.......
注:“.”标识父子的关系。
现在通过id_查询树结构的效果,并且知道此节点是否为叶子节点leaf。。?
语句如下:
select
......
表空间:
Oracle的UNDOTBS01.DBF文件太大的解决办法
1、.禁止undo tablespace自动增长
alter database datafile 'full_path\undotbs01.dbf' autoextend off;
2.-- 创建一个新的小空间的undo tablespace
create undo tablespace undotBS2 datafile ......