oracle取字符串长度的函数length()和hengthb()
lengthb(string)计算string所占的字节长度 :返回字符串的长度,单位是字节
length(string)计算string所占的字符长度 :返回字符串的长度,单位是字符
对于单字节字符,LENGTHB和LENGTH是一样的.
如可以用length(‘string’)=lengthb(‘string’)判断字符串是否含有中文。
select length('我') from dual --返回1
select lengthb('我') from dual --返回2
select length('AB') from dual --返回2
select lengthb('AB') from dual --返回2
(thismonth)转贴:http://space.itpub.net/161195/viewspace-613263
相关文档:
SqlServer,Oracle 常用函数比较
数学函数:
1.绝对值
Sql Server: SELECT abs(-1) value
Oracle: SELECT abs(-1) value from dual
2.取整(大)
Sql Server: SELECT ceiling(-1.001) value
Oracle: SELECT ceil(-1.001) value from dual
3.取整(小)
Sql Server: SELECT f ......
一.表空间学习
个人觉得表空间相对于数据库来说是至关重要的,一般分为permanent(永久性表空间),undo(undo表空间),temporary(临时表空间),一般我们是通过以下sql进行查看表空间的类型的.
select distinct t.contents from dba_tablespaces t;
查看表空间所对应的数据文件。
select t.name,t1.name
from v$tablespace ......
Just a few days ago a got to two Oracle DBAs discussing why the have so much “PX Deq Credit : send blkd” on a system. And if that is causing their performance problems.
The are some blog on the internet claiming it has to do with qc distribution and what ever.
But in many cases, especi ......
oracle wait event:cursor: pin S wait on X
cursor: pin S wait on X等待事件的处理过程
http://database.ctocio.com.cn/tips/114/8263614_1.shtml
cursor: pin S wait on X等待!
http://www.itpub.net/viewthread.php?tid=1003340
解决cursor: pin S wait on X 有什么好办法:
http://www.itpub.net/thread-1163543 ......
语法:
substr( string, start_position, [ length ] )
取子字符串,从start_position开始,取length个,length为可选,如果length为空则返回start_position后的所有字符。
实例:
substr('This is a test', 6, 2) would return 'is'
&nbs ......