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
相关文档:
TO_DATE格式(以时间:2007-11-02 13:45:25为例)
Year:
yy two digits 两位年 ......
对于 Oracle 的 rownum 问题,很多资料都说不支持>,>=,=,between...and,只能用以上符号(<、<=、!=),并非说用>,>=,=,between..and 时会提示SQL语法错误,而是经常是查不出一条记录来,还会出现似乎是莫名其妙的结果来,其实您只要理解好了这个 rownum 伪列的意义就不应该感到惊奇,同样是伪列,rownum ......
权限管理
Oracle 9i
3个默认用户
sys(超级管理员) 默认密码:change_on_install
system(普通管理员)
默认密码:manager
scott(普通用户) 默认密码:tiger
Oracle 10g
sys(密码在安装时设置)
system(密码在安装时设置)
scott(默认锁定,想用得解锁)
启动Windo ......
1.用Oracle用户登陆Linux服务器;
2.在终端窗口输入 sqlplus /nolog
[oracle@hylinux ~]$ sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on 星期二 7月 29 14:26:16 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
& ......
网上有很多资料,也是参考eygle的文档。
OS : Redhat AS 4 U5
DB : Oracle 10.2.0.3
1.修改jdk 下面的字体。
[oracle@rac2 db_1]$ cd $ORACLE_HOME/jdk/jre/lib/
[oracle@rac2 lib]$ mv font.properties font.properties_bak
[oracle@rac2 lib]$
[oracle@rac2 lib]$ cp font.properties.zh_CN.Redhat font.propertie ......