Home  >  Article  >  Database  >  What functions are there in mysql

What functions are there in mysql

anonymity
anonymityOriginal
2019-05-09 14:01:5523761browse

The functions in mysql are: 1. concat(); 2. strcmp(); 3. length(); 4. char_length(); 5. upper(); 6. lower(); 7. abs(); 8. ceil(). In addition, mysql has many built-in functions.

What functions are there in mysql

mysql functions

MySQL has many built-in functions. Descriptions of these functions are listed below.

Aggregation function

avg

count

max

min

sum

#Function used to process strings

Merge string function: concat(str1,str2,str3…)

Compare string size function: strcmp(str1,str2)

Get the number of bytes in a string function: length(str)

Get the number of characters in a string function: char_length(str)

Letter case conversion function: uppercase: upper(x),ucase(x); lowercase lower(x),lcase(x)

Function used to process numerical values

Absolute value function: abs(x)

Up rounding function: ceil(x)

Down rounding function: floor(x)

Modulo function: mod(x,y)

Random number function: rand()

Rounding function: round(x,y)

Numerical interception function : truncate(x,y)

Function used to process time and date

Get the current date: curdate(), current_date()

Get Current time: curtime(), current_time()

Get the current date and time: now()

Select the number of months from the date: month(date),monthname(date)

Select the number of weeks from the date: week(date)

Select the number of weeks from the date: year(date)

Select the number of hours from the time: hour(time )

Select the minute from the time: minute(time)

Select the day of the week from the time: weekday(date),dayname(date)

The above is the detailed content of What functions are there in mysql. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn