Mysql common functions

Source: Internet
Author: User
Welcome to the Linux community forum, and interact with 2 million technical staff to enter the common text processing function Left () returns the Length of the string to the Left of the string () return the Length of the string Locate () find a substring of a string. Lower () converts the string to lowercase LTrim (). Remove the space Right () on the left of the string. Return the character RTrim () on the Right of the string. Remove the character on the Right of the string.

Welcome to the Linux community forum and interact with 2 million technical staff> go to the common text processing function Left () and return the Length of the string Locate () to the Left of the string () find a substring of a string. Lower () converts the string to lowercase LTrim (). Remove the space Right () on the left of the string. Return the character RTrim () on the Right of the string. Remove the character on the Right of the string.

Welcome to the Linux community forum and interact with 2 million technicians>

Common text processing functions

Left () returns the character on the Left of the string.

Length () returns the Length of the string.

Locate a substring of a string

Lower () converts string to lowercase

LTrim () removes spaces on the left of the string

Right () returns the character on the Right of the string.

RTrim () removes spaces on the right of the string

Soundex () returns the SOUNDEX value of the string

SubString () returns the character of the SubString.

SubString_index () returns the substrings. substring_index (abcdce, c, 1) starts from all the characters before the first c, and-1 is the subsequent characters.

Upper () converts string to uppercase

Date and time processing functions

Date Format: yyyy-mm-dd

AddDate () adds a date (days, weeks, etc)

AddTime () adds a time (hour, grade)

CurDate () returns the current date

CurTime () returns the current time

Date () returns the Date part of the Date and time.

DateDiff () calculates the difference between two dates

Date_Add () highly flexible date operation functions

Date_Format () returns a formatted date or time string.

Day () returns the number of days of a date.

DayOfWeek () returns a date and the day of the week.

Hour () returns the Hour of a time.

Minute () returns the Minute of a time.

Month () returns the Month of a date.

Now () returns the current date and time

Second () returns the Second part of a time.

Time () returns the Time part of a date and Time.

Year () returns the Year of a date.

Numeric processing functions

Abs () returns the absolute value of a number.

Cos () returns the cosine of an angle.

Exp () returns the exponential value of a number.

Mod () returns the remainder of the division operation

Pi () returns the circumference Rate

Rand () returns a random number.

Sin () returns the sine of an angle.

Sqrt () returns the square root of a number.

Tan () returns the tangent of an angle.

Aggregate Function: a function that runs on a row group to calculate and return a single value.

AVG () returns the average value of a column

COUNT () returns the number of rows in a column.

MAX () returns the maximum value of a column.

MIN () returns the minimum value of a column.

SUM () returns the SUM of values of a column.

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.