需求:对一个包含数字的字符串排序

search后参考了  http://www.cnblogs.com/m-cnblogs/archive/2012/03/30/2425938.html

截屏:

(用到了to_number(str,split 1,...)   instr()  replace()  substr())

TO_NUMBER(x [, format], [ nls_language ]) 

converts x to a NUMBER.

  • x is the string that will be converted to a number.
  • format, optional, is the format that will be used to convert x to a number.
  • nls_language, optional, is the nls language used to convert x to a number

INSTR(string, pattern-to-find)

INSTR returns the location (beginning) of a pattern in a given string. Its simple form is:

The general syntax of INSTR is:

INSTR (string to search, search pattern [, start [,occurrence]])

The arguments within brackets ([]) are optional.

在一个字符串中查找指定的字符,返回被查找到的指定的字符的位置。

如果start的值为负数,则代表从右往左进行查找,但是位置数据仍然从左向右计算。

SUBSTR retrieves a portion of the string. The general format for this function is:

SUBSTR(string, start_at_position[, number_of_characters_to_retrieve])  
从给定的字符表达式返回一个子字符串。    
REPLACE(source-string, pattern-to-find, pattern-to-replace-by)

(to)‘2011-10-11’  ‘2011/10/11’ 转换

update 表1 t set t.列1=replace((select 列1from 表1 a where a.主键列=t.主键列) , '/' , '-' )

例:select  replace ('111222333444','222','888') from dual;

输出为 '111888333444'

最后我的代码

pn
to_number(str,’-’)

str:

replace(source ,’-’)

source:

substr(pn,instr(pn,’-’)+1, 
length(pn)-1-instr(pn,’-’))

最新文章

  1. CRM 2013 相关下载 / 2013-10-11
  2. 分分钟教你从根本上认识Struts2框架
  3. 6个关于dd命令备份Linux系统的例子
  4. SpringMVC、Struts1、Struts2和SSH2框架中单例与多例的解析
  5. 【NOIP模拟赛】lover——心上人
  6. C# 获取当前星期几三种实现方法(转)
  7. ZSDRM001-发货清单
  8. winform下mapxtreme2008 v7.0 生成release版提示找不到dll问题
  9. Codeforces Round #154 (Div. 2) : B
  10. C++ deepin
  11. HDU 3030 - Increasing Speed Limits
  12. webpack配置报错:invalid configuration object.webpack has been initialisted using a configuration objcet that does not match thie API schema
  13. java并发之CyclicBarrier
  14. 使用Phalcon框架开发一个简易的博客系统
  15. vsftp为不同用户设置不同的ftp的根目录
  16. WINDOWS自带md5校验工具
  17. embedding与word2vec
  18. Javascript Property Names
  19. lucene查询索引之QueryParser解析查询——(八)
  20. 错误:Parameter '0' not found.Available parameters are [arg1, arg0, param1, param2]的解决方法

热门文章

  1. 九度oj 题目1482:玛雅人的密码 清华大学机试
  2. 简单实用jstl实现“登录|注册”
  3. 性能学习之--loaderunner压测
  4. ACM程序设计选修课——1044: (ds:队列)打印队列(queue模拟)
  5. P1438 无聊的数列 (线段树)
  6. testng依赖
  7. python语言基础问题汇总
  8. FWT 学习笔记
  9. unity3d各平台通讯原生的平台API的说明
  10. iOS11及Xcode9适配问题汇总