1000 Lines MySQL study notes (10)

Source: Internet
Author: User

--//built-in functions----------
--Numerical functions
ABS (x)--Absolute ABS ( -10.9) = Ten
Format (x, D)--formats the value of the Thousand Decimal place Format (1234567.456, 2) = 1,234,567.46
ceil (x)--Rounding up ceil (10.1) = One
Floor (x)--Take down floor (10.1) = Ten
round (x)-Rounding off the whole
mod (m, N)--m%n m mod n to find remainder 10%3=1
Pi ()--Get pi
Pow (M, N)--M^n
sqrt (x)--The square root of arithmetic
rand ()--Random number
truncate (x, D)--intercept D decimal

--time-date function
now (), Current_timestamp ();---Current date Time
current_date ();--Current date
Current_time ();--Current time
Date (' Yyyy-mm-dd hh:ii:ss ');---Get date part
time (' Yyyy-mm-dd hh:ii:ss ');----Get The Times section
date_format (' Yyyy-mm-dd hh:ii:ss ', '%d%y%a%d%m%b%j ');---Format time
Unix_timestamp ();---Get UNIX timestamp
From_unixtime ();--Get time from timestamp

--String function
Length (String)--string length, Bytes
char_length (String)--the number of characters in string
substring (str, position [, length])--starting with the position of STR, taking a length character
Replace (str, SEARCH_STR, REPLACE_STR)--Replaces search_str with REPLACE_STR in str
InStr (String, substring)--Returns the position of the first occurrence of the substring in a string
concat (string [,...])--Connection string
CharSet (str)--return string character set
LCase (String)-- convert to lowercase
Left (string, length)-The length of a character from the string2
Load_file (file_name)--read content from a file
Locate (substring, string [, Start_position])--same as InStr, but can specify start position
Lpad (string, length, pad)--repeats the pad with the start of string until the string length is
LTrim (String)--remove front-end spaces
Repeat (String, count)--repeats count times
rpad (string, length, pad)--supplemented with pad after str, until length
RTrim (String)--Remove back-end spaces
strcmp (string1, string2)--character comparison two string size

--Process functions
case is [condition] then result [when [condition] then result ...] [Else result] End multi-branch
if (EXPR1,EXPR2,EXPR3) dual branch.

--Aggregation function
count ()
sum ();
Max ();
min ();
avg ();
Group_concat ()

--Other common functions
MD5 ();
default ();

(Shocker Source: http://www.cnblogs.com/shockerli/p/1000-plus-line-mysql-notes.html)

1000 Lines MySQL study notes (10)

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.