public static String zipString(String str){ String result = "";//用于拼接新串的变量 char last = str.charAt(0);//用于获取下一个单个字符 int length = str.length();//获取字符串长度,用于遍历的条件 int count = 1;//计数器,用于记录每个字符重叠的次数 for(int i = 1 ; i<length ; i++){//从第二个索引开始判断 if(l
众所周知,静态SQL的输出结构必须也是静态的.对于经典的行转列问题,如果行数不定导致输出的列数不定,标准的答案就是使用动态SQL, 到11G里面则有XML结果的PIVOT. 但是 oracle 10G 没有 PIVOT 函数怎么办,自己写一个不久有了.上代码 直接点. CREATE OR REPLACEtype PivotImpl_shx as object( ret_type anytype, -- The return type of the table function stmt varc
最近研究sql优化,以下文章转自互联网: 1. 语法 单表:UPDATE 表名称 SET 列名称 = 新值 WHERE 列名称 = 某值 如:update t_join_situation set join_state='1'whereyear='2011' 更新年度为“2011”的数据的join_state字段为“1”.如果更新的字段加了索引,更新时会重建索引,更新效率会慢. 多表关联,并把一个表的字段值更新到另一个表中的字段去: update 表a set a.字段1 = (s
原文:http://norvig.com/spell-correct.html 翻译:http://blog.youxu.info/spell-correct.html 怎样写一个拼写检查器 Peter Norvig 翻译: Eric You XU 上个星期, 我的两个朋友 Dean 和 Bill 分别告诉我说他们对 Google 的快速高质量的拼写检查工具感到惊奇. 比如说在搜索的时候键入 [speling], 在不到 0.1 秒的时间内, Google 会返回: 你要找的是不是 [spell
oracle之sql语句优化 sql语句的优化 1.在where子句中使用 is null 或 is not null 时,oracle优化器就不能使用索引了. 2.对于有连接的列,即使最有一个是静态的值,优化器也不会使用索引 比如: select * from employss where first_name||''||last_name='Beill cliton' 要写成 :select * from employss where first_name='Beill' and last_
各种oracle参数查询语句 1.show parameter:--显示各个系统参数配置 2.select * from v$parameter;--显示各个系统参数配置 2.show parameter 参数名;--显示具体参数的配置情况 3.select * from v$parameter where name='参数名';--显示具体参数的配置情况 4.select * from nls_database_parameters;--服务器字符集查询5.select * from nls_