ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Recipe 6.7. Extracting Initials from a Name

Recipe 6.7. Extracting Initials from a Name

原创 Linux操作系统 作者:wuxidba 时间:2010-12-09 14:08:17 0 删除 编辑

1. translate把要改的挑出

2.replace掉

You want convert a full name into initials. Consider the following name:

	 Stewie Griffin


 

You would like to return:

	 S.G.
 
 
select replace ( translate (ename, 'abcdefghijklmnopqrstuvwxyz',rpad('a',26,'a.')),'a','' )   
from emp_1
where esal = '2000'


 

 

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/23895263/viewspace-681368/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2010-05-12

  • 博文量
    64
  • 访问量
    73601