SQL statement character function, numeric function

Source: Internet
Author: User
Tags abs acos cos mathematical functions rtrim square root truncated

1 --character Functions2 3 --ASCII (x) returns the ASCII code of the character x4 Select ASCII('a') fromDUAL;--back to5 6 --CONCAT (x, y) connection string X and Y7 SelectConcat'123','456') fromDual--back to 123 4568 9 --INSTR (x,str [, start][,n): Find str in X, you can specify starting from start, or you can specify starting at nth timeTen SelectInStr'HAHDF','F') fromDual--returns the location of Str One  A --Length (x) returns the lengths of X - SelectLength'd545') fromDual--returns 4 -  the --Lower (x) turns x to lowercase - Select Lower('ABCD') fromDual--back to ABCD -  - --Upper (x) turn x to uppercase + Select Upper('ABCDE') fromDual--back to ABCDE -  + --LTrim (X,[STR]) truncate the left edge of X to the STR string, and the default is to truncate the space A SELECT LTrim('===hello===','=') fromDUAL--back to hello=== at  -  - --RTrim (X,[str]) to the right of X to intercept the STR string, the default truncation of space - SELECT RTrim('===hello===','=') fromDUAL--back to ===hello -  - --trim ([str from] x) truncates the STR string on both sides of X, and truncates the space by default in SELECTTRIM ('='  from '===hello===') fromDUAL;--return HELLO -  to --Replace (x,old,new) finds an old in X and replaces it with the new + Select Replace('Avaddfs','D','e') fromDual--return result Avaeefs -  the --substr (X,start,[,length]) returns the string of X, starting at start, * --intercept length characters, default length, defaults to end $ SelectSubstr'ABCDEFG',2,4) fromDual--return: BCDEPanax Notoginseng  -  the --Mathematical Functions + --ABS (x) x absolute A Select ABS(-5) fromDual--returns 5 the  + --Inverse cosine of ACOs (x) x - Select ACOs(1) fromDual--returns 0 $  $ --cos (x) cosine - Select Cos(1) fromDual--back to 0.54030230586814 -  the --ceil (x) is greater than or equal to the minimum value of x - SelectCeil (5.2) fromDual--returns 6Wuyi  the --Floor (x) is less than or equal to the maximum value of x - Select  Floor(5.2) fromDual--returns 5 Wu  -  About --log (x, y) x is the logarithm of the low y $ Select Log(2,2) fromDual--returns 1 -  - --mod (x, y) x divided by the remainder of Y - SelectMoD2,3) fromDual--returns 2 A  + --Power (x, y) x power the Select Power(2,3) fromDual--returns 8 -  $ --round (X[,y]) x rounding in the Y position the --y defaults to 0, if Y is negative, 0 is truncated to the right of the decimal point, and if Y is positive, the decimal point is cut to the left. the Select round(2.2160,2) fromDual--Back to 2.22 the  the --the square root of sqrt (x) x - Select sqrt(4) fromDual--returns 2 in  the --trunc (X[,y]) x is truncated in the Y-bit, not rounded.  the --y defaults to 0, if Y is negative, 0 is truncated to the right of the decimal point, and if Y is positive, the decimal point is cut to the left. About SelectTrunc334.255,-1) fromDual--return to

SQL statement character function, numeric function

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: info-contact@alibabacloud.com 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.