oracle function - character function



 Here is a summary of some of my notes during my study:

1.Replace replace when displayed
 select replace(ename,'A','China') from emp;
 2.Instr(c1,c2,I,J) find the position where the specified character appears
  C1 original string C2 specified string I start The nth occurrence of the initial position J
  Select instr('oracle traing','ra',1,2) from dual;(virtual table)
 3.Ascii returns the ascii value of the string
  Select ascii('A'),ascii(' a'),ascii('0') from dual;
 4.Chr gives an integer and returns the character
  Select chr(54740), chr(65) from dual;
 5.Concat connection string has the same effect as ||
  Select concat(ename ,'haha')from emp;
 6.Initcap returns a string, and capitalizes the first character of the string, other lowercase
  Select initcap(ename) from emp;
 7.Length string length (Chinese characters only occupy 1 character size)
  Select length(ename)from emp;
 8.Lower lowercase all characters
  Select lower(ename)from emp;
 9.Upper uppercase all characters
  Select upper(ename)from emp;
 10.Substr take a string
  Select substr(‘aaasss’,2,4) from dual;

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324776166&siteId=291194637