18. 求集合最大值
S:select max(value) value from
(select 1 value
union
select -2 value
union
select 4 value
union
select 3 value)a
O:select greatest(1,-2,4,3) value from dual
19. 求集合最小值
S:select min(value) value from
(select 1 value
union
select -2 value
union
select 4 value
union
select 3 value)a
O:select least(1,-2,4,3) value from dual
20.如何处理null值(F2中的null以10代替)
S:select F1,IsNull(F2,10) value from Tbl
O:select F1,nvl(F2,10) value from Tbl
--------数值间比较
21.求字符序号
S:select ascii('a') value
O:select ascii('a') value from dual
22.从序号求字符
S:select char(97) value
O:select chr(97) value from dual
23.连接
S:select '11'+'22'+'33' value
O:select CONCAT('11','22')||33 value from dual
23.子串位置 --返回3
S:select CHARINDEX('s','sdsq',2) value
O:select INSTR('sdsq','s',2) value from dual
23.模糊子串的位置 --返回2,参数去掉中间%则返回7
S:select patindex('%d%q%','sdsfasdqe') value
Oracle没发现,但是instr可以通过第四霾问刂瞥鱿执问?BR> select INSTR('sdsfasdqe','sd',1,2) value from dual 返回6
24.求子串
S:select substring('abcd',2,2) value
O:select substr('abcd',2,2) value from dual
25.子串代替 返回aijklmnef
S:SELECT STUFF('abcdef', 2, 3, 'ijklmn') value
O:SELECT Replace('abcdef', 'bcd', 'ijklmn') value from dual
26.子串全部替换
S:没发现
O:select Translate('fasdbfasegas','fa','我' ) value from dual
27.长度
S:len,datalength
O:length
28.大小写转换 lower,upper
29.单词首字母大写
S:没发现
O:select INITCAP('abcd dsaf df') value from dual
30.左补空格(LPAD的第一个参数为空格则同space函数)
S:select space(10)+'abcd' value
O:select LPAD('abcd',14) value from dual
31.右补空格(RPAD的第一个参数为空格则同space函数)
S:select 'abcd'+space(10) value
O:select RPAD('abcd',14) value from dual
32.删除空格
S:ltrim,rtrim
O:ltrim,rtrim,trim
33. 重复字符串
S:select REPLICATE('abcd',2) value
O:没发现