What functions are there in mysql

anonymity
Release: 2020-09-16 17:07:04
Original
23684 people have browsed it

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!

Related labels:
source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!