1. ASCII
Returns the decimal number corresponding to the specified character;
Sql> Select ASCII (a) a,ascii (a) a,ascii (0) Zero,ascii () space from dual;
A A ZERO space
--------- --------- --------- ---------
65 97 48 32
2. CHR gives the integer, returns the corresponding character;
Sql> Select Chr (54740) ZHAO,CHR () chr65 from dual;
En C
-- -
Zhao A
3. CONCAT
Connect two strings;
Sql> Select Concat (010-,88888888) | | Turn 23 high-dry telephone from dual;
Gao Hu Phone
----------------
010-88888888 ext. 23
4. Initcap
Returns a string and turns the first letter of the string into uppercase;
Sql> Select Initcap (Smith) Upp from dual;
UPP
-----
Smith
5.INSTR (c1,c2,i,j) searches a string for the specified character, returning the location of the specified character;
C1 the string being searched
C2 the string you want to search for
The starting position of the I search, which defaults to the location of 1 J, defaults to 1 sql> Select InStr (Oracle traning,ra,1,2) instring from dual;
Instring
---------
9
6.LENGTH
Returns the length of the string;
Sql> Select Name,length (name), Addr,length (addr), Sal,length (To_char (SAL)) from GAO.NCHAR_TST;
Name Length (name) ADDR Length (ADDR) SAL Length (To_char (SAL))
------ ------------ ---------------- ------------ --------- --------------------
Gao Hu 3 Beijing Sea ingot Area 6 9999.99 7
7.LOWER returns a string and converts all characters to lowercase
Sql> Select Lower (AABBCCDD) AABBCCDD from dual;
Aabbccdd
--------
Aabbccdd
8.UPPER returns the string and capitalizes all the characters
Sql> Select UPPER (AABBCCDD) upper from dual;
UPPER
--------
Aabbccdd
9.RPAD and Lpad (paste characters)
Rpad paste characters to the right of the column
Lpad paste characters to the left of the column
Sql> Select Lpad (Rpad (gao,10,*), 17,*) from dual;
Lpad (Rpad (gao,1
-----------------
gao*******
Not enough characters to fill with *
10.LTRIM and RTrim
LTrim deletes the string appearing on the left
RTrim Delete the string that appears on the right
Sql> Select LTrim (RTrim (Gao Qian Jing,) from dual;
LTRIM (RTRIM (
-------------
11.SUBSTR (String,start,count) takes a substring, starting with start, Count sql> select SUBSTR (13088888888,3,8) from dual;
SUBSTR (
--------
08888888
12.REPLACE (STRING,S1,S2)
String the character or variable you want to be replaced
S1 the replaced string
S2 the string to replace
Sql> Select replace (he love You,he,i) from dual;
REPLACE (H
----------
I love You
13.SOUNDEX
Returns a string with the same pronunciation as the given string
Sql> CREATE TABLE table1 (XM varchar (8));
sql> INSERT INTO table1 values (weather);
sql> INSERT INTO table1 values (wether);
sql> INSERT INTO table1 values (GAO);
Sql> Select XM from table1 where Soundex (XM) =soundex (weather);
Xm
--------
Weather
Wether
14.TRIM (s from string)
Leading cut off the front characters
Trailing cut off the back characters
If not specified, default is spaces
15.ABS
Returns the absolute values of a specified value
Sql> Select ABS (M), ABS ( -100) from dual;
ABS (-100)
--------- ---------
100 100
16.ACOS
Give the value of the inverse cosine
Sql> Select ACOs ( -1) from dual;
ACOS (-1)
---------
3.1415927
17.ASIN
Give the value of the string anyway
Sql> Select ASIN (0.5) from dual;
ASIN (0.5)
---------
.52359878
18.ATAN
Returns the tangent value of a number
Sql> Select Atan (1) from dual;
Atan (1)
---------
.78539816
19.CEIL
Returns the smallest integer greater than or equal to the given number
Sql> Select Ceil (3.1415927) from dual;
Ceil (3.1415927)
---------------
4
20.COS
Returns the cosine of a given number
sql> Select cos ( -3.1415927) from dual;
COS (-3.1415927)
---------------
-1