【转】oracle的substr函数的用法oracle的substr函数的用法取得字符串中指定起始位置和长度的字符串substr(string,start_position,[length])如:substr('Thisisatest',6,2)wouldreturn'is'substr('This...
分类:
数据库 时间:
2015-12-22 23:08:43
阅读次数:
359
#!/bin/shETHS=`cat /proc/net/dev | awk '{if(NR > 2) print substr($1, 0, index($1, ":") - 1)}'`for ETH in $ETHSdo if [ $ETH != "lo" ] then ...
分类:
其他好文 时间:
2015-12-22 19:16:46
阅读次数:
147
已验证。要求:A.数据库表中的一个字符串 可能含有"+" 例:ORC+001 也可能不含“+” B.要求如果该字符串含有“+”,则取“+”之前的字符 例:ORC+001 取ORC C.如果该字符串不含"+",则直接取该字符串。 解答:利用ORACLE中 INSTR,SUBSTR以及CASE ...
分类:
数据库 时间:
2015-12-22 17:51:58
阅读次数:
595
最近做数据清理的时候,发现字符里面有很多特殊字符,如果想截取字符串中的一段字符可以用以下方法:/*截取中文括号前面的字符*/data _null_;x="aaafafsadfgadgfa(asdasgs..";/*定义字符串*/i=find(x,'(');/*确定(的位置*/j=length(x);...
分类:
其他好文 时间:
2015-12-22 16:24:51
阅读次数:
169
CleverCode发现smarty中调用php内置函数可以通过|实现。|前后没有空格。如果是数组求count需要加上@。
1个参数时候:
{{'param1'|functionName}}
例如
{{$tmpStr|strlen}}
2个参数时候:
{{'param1'|functionName:'param2'}}
{$tmpStr|substr:'1'}
多个...
分类:
Web程序 时间:
2015-12-21 20:23:41
阅读次数:
148
Oracle经常使用函数 ——TRUNC,TO_DATE,TO_CHAR,TO_NUMBER, SUBSTR,REPLACE。NVL。TRIM,wm_concat,upper, lower,length,add_months(sysdate,1)查看oracle版本号: SELECT * from ...
分类:
数据库 时间:
2015-12-18 13:03:55
阅读次数:
227
js中substr,substring,indexOf,lastIndexOf等的用法1.substrsubstr(start,length)表示从start位置开始,截取length长度的字符串。var src="images/off_1.png";alert(src.substr(7,3));弹...
分类:
其他好文 时间:
2015-12-16 23:02:41
阅读次数:
610
在截取字符串时常常会用到substr()、substring()、slice()方法,有时混淆之间的用法,故总结下。slice()定义:接受一个或者两个参数,第一个参数指定子字符串的开始位置。第二个参数表示子字符串的结束位置(不包括结束位置的那个字符),如果没有传递第二个参数,则将字符串的长度作为结...
分类:
其他好文 时间:
2015-12-16 01:38:34
阅读次数:
163
(SELECT p.*,(SELECT CONCAT(m.name,m.id) FROM service_fastfix_category m WHERE m.id=SUBSTR(p.id,1,4)) AS parentcode,(SELECT GROUP_CONCAT(ee.name)FROM e...
分类:
其他好文 时间:
2015-12-11 22:18:19
阅读次数:
304
整数不超过10为,小数不超过4位。function hehe(num){ if(num==""||num==null||num==0||isNaN(num)||num==undefined||num10?num.substr(0,10):num; }else if(index==...
分类:
其他好文 时间:
2015-12-11 01:25:50
阅读次数:
198