免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 6832 | 回复: 1
打印 上一主题 下一主题

[分享] oracle中substr函数的用法 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2012-10-30 16:41 |只看该作者 |倒序浏览
本帖最后由 bjfmd 于 2012-10-30 16:41 编辑

In oracle/PLSQL, the substr functions allows you to extract a substring from a string.  

The syntax for the substr function is:
  substr( string, start_position, [ length ] )
  说明:
  string is the source string.
  start_position is the position for extraction. The first position in the string is

always 1.
  length is optional. It is the number of characters to extract. Ifthis parameter is

omitted, substr will return the entire string.
  For example:
  substr('This is a test', 6, 2) would return 'is'
  substr('This is a test', 6) would return 'is a test'
  substr('TechOnTheNet', 1, 4) would return 'Tech'
  substr('TechOnTheNet', -3, 3) would return 'Net'
  substr('TechOnTheNet', -6, 3) would return 'The'
  substr('TechOnTheNet', -8, 2) would return 'On'

更多技术资料请访问CUUG.com/CUUG官网

论坛徽章:
26
2015亚冠之胡齐斯坦钢铁
日期:2015-06-25 21:40:202015亚冠之柏斯波利斯
日期:2015-08-31 17:03:192015亚冠之柏斯波利斯
日期:2015-11-07 13:10:00程序设计版块每日发帖之星
日期:2015-11-10 06:20:00每日论坛发贴之星
日期:2015-11-10 06:20:00程序设计版块每日发帖之星
日期:2015-11-26 06:20:00程序设计版块每日发帖之星
日期:2015-12-02 06:20:00黄金圣斗士
日期:2015-12-07 17:57:4615-16赛季CBA联赛之天津
日期:2015-12-23 18:34:14程序设计版块每日发帖之星
日期:2016-01-02 06:20:00程序设计版块每日发帖之星
日期:2016-01-06 06:20:00每日论坛发贴之星
日期:2016-01-06 06:20:00
2 [报告]
发表于 2013-10-17 22:13 |只看该作者
这个有意思了!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP