MySQL String Functions
MySQL String Functions
Function Description
INSERT Inserts a string within a string at the specified position and for a certain number of characters
INSTR Returns the position of the first occurrence of a string in another string
REPLACE Replaces all occurrences of a substring within a string, with a new substring
ADVERTISEMENT
MySQL Numeric Functions
Function Description
LOG Returns the natural logarithm of a number, or the logarithm of a number to a specified base
POW Returns the value of a number raised to the power of another number
POWER Returns the value of a number raised to the power of another number
Function Description
ADDDATE Adds a time/date interval to a date and then returns the date
ADDTIME Adds a time interval to a time/datetime and then returns the time/datetime
DATE_ADD Adds a time/date interval to a date and then returns the date
DATE_SUB Subtracts a time/date interval from a date and then returns the date
DAY Returns the day of the month for a given date
LAST_DAY Extracts the last day of the month for a given date
LOCALTIME Returns the current date and time
MAKEDATE Creates and returns a date based on a year and a number of days value
MAKETIME Creates and returns a time based on an hour, minute, and second value
QUARTER Returns the quarter of the year for a given date value
SUBDATE Subtracts a time/date interval from a date and then returns the date
SUBTIME Subtracts a time interval from a datetime and then returns the time/datetime
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
Function Description
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 clien
IFNULL Return a specified value if the expression is NULL, otherwise return the expression
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