Oracle ceil cos ASCII CHR function

Source: Internet
Author: User
Tags abs acos asin chr cos rtrim


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


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;




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;





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;




8.UPPER returns the string and capitalizes all the characters

Sql> Select UPPER (AABBCCDD) upper from dual;




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



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;



Gao Qian Jing
11.SUBSTR (String,start,count) takes a substring, starting with start, Count sql> select SUBSTR (13088888888,3,8) from dual;





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;



I love You


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);





14.TRIM (s from string)

Leading cut off the front characters

Trailing cut off the back characters

If not specified, default is spaces


Returns the absolute values of a specified value

Sql> Select ABS (M), ABS ( -100) from dual;

ABS (-100)

--------- ---------

100 100


Give the value of the inverse cosine

Sql> Select ACOs ( -1) from dual;

ACOS (-1)




Give the value of the string anyway

Sql> Select ASIN (0.5) from dual;

ASIN (0.5)




Returns the tangent value of a number

Sql> Select Atan (1) from dual;

Atan (1)




Returns the smallest integer greater than or equal to the given number

Sql> Select Ceil (3.1415927) from dual;

Ceil (3.1415927)




Returns the cosine of a given number

sql> Select cos ( -3.1415927) from dual;

COS (-3.1415927)



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.