MySQL Functions
MySQL Functions
Dark code
HTML CSS
Bootcamp Menu Log in
MySQL Functions
❮ Previous Next ❯
This reference contains string, numeric, date, and some advanced functions in
MySQL.
Dark mode
https://www.w3schools.com/mysql/mysql_ref_functions.asp
D k d 1/11
3/1/23, 9:56 PM MySQL Functions
Dark code
INSTR
HTML CSSReturns the position of the first occurrence of a string
in
another string
delimiter occurs
Dark code
HTML CSS
TRIM Removes leading and trailing spaces from a string
GREATEST Returns the greatest value of the list of arguments Dark mode
https://www.w3schools.com/mysql/mysql_ref_functions.asp
D k d 3/11
3/1/23, 9:56 PM MySQL Functions
Dark code
LEAST
HTML Returns the smallest value of the list of arguments
CSS
LN Returns the natural logarithm of a number
LAST_DAY Extracts the last day of the month for a given date
Dark mode
https://www.w3schools.com/mysql/mysql_ref_functions.asp
D k d 5/11
3/1/23, 9:56 PM MySQL Functions
Dark code
LOCALTIME
HTML CSS Returns the current date and time
LOCALTIMESTAMP Returns the current date and time
QUARTER Returns the quarter of the year for a given date value
expressions
Dark code
HTML CSS
TIMESTAMP Returns a datetime value based on a date or datetime value
TO_DAYS Returns the number of days between a date and date "0000-
00-00"
YEARWEEK Returns the year and week number for a given date
CASE Goes through conditions and return a value when the first
condition is met
CURRENT_USER Returns the user name and host name for the MySQL account
that the server used to authenticate the current client
condition is FALSE
Dark code
HTML CSS
IFNULL Return a specified value if the expression is NULL, otherwise
return the expression
LAST_INSERT_ID Returns the AUTO_INCREMENT id of the last row that has been
inserted or updated in a table
NULLIF Compares two expressions and returns NULL if they are equal.
Otherwise, the first expression is returned
SESSION_USER Returns the current MySQL user name and host name
SYSTEM_USER Returns the current MySQL user name and host name
USER Returns the current MySQL user name and host name
❮ Previous Next ❯
COLOR PICKER
Dark mode
https://www.w3schools.com/mysql/mysql_ref_functions.asp
D k d 8/11
3/1/23, 9:56 PM MySQL Functions
Dark code
HTML CSS
Get certified
by completing
a course today!
school
w3 s
3
CE
TI 02 2
R
FI .
ED
Get started
Dark mode
https://www.w3schools.com/mysql/mysql_ref_functions.asp
D k d 9/11
3/1/23, 9:56 PM MySQL Functions
Dark code
HTML CSS Report Error
Spaces
Upgrade
Newsletter
Get Certified
Top Tutorials
HTML Tutorial
CSS Tutorial
JavaScript Tutorial
How To Tutorial
SQL Tutorial
Python Tutorial
W3.CSS Tutorial
Bootstrap Tutorial
PHP Tutorial
Java Tutorial
C++ Tutorial
jQuery Tutorial
Top References
HTML Reference
CSS Reference
JavaScript Reference
SQL Reference
Python Reference
W3.CSS Reference
Bootstrap Reference
PHP Reference
HTML Colors
Java Reference
Angular Reference
jQuery Reference
Top Examples
HTML Examples
CSS Examples
JavaScript Examples
How To Examples
SQL Examples
Python Examples
W3.CSS Examples
Bootstrap Examples
Dark mode
https://www.w3schools.com/mysql/mysql_ref_functions.asp
D k d 10/11
3/1/23, 9:56 PM MySQL Functions
Get Certified
HTML Certificate
CSS Certificate
JavaScript Certificate
Front End Certificate
SQL Certificate
Python Certificate
PHP Certificate
jQuery Certificate
Java Certificate
C++ Certificate
C# Certificate
XML Certificate
FORUM | ABOUT
W3Schools is optimized for learning and training. Examples might be simplified to improve reading and
learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant
full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use,
cookie and privacy policy.
https://www.w3schools.com/mysql/mysql_ref_functions.asp 11/11