List of mysql functions

In this tutorial there is list of mysql functions that you most commonly used in your web application including aggregate, string, date time, control flow, other functions and etc.

MySQL aggregate functions

MySQL AVG : Use MySQL AVG function to calculate the average value of a set of values or an expression.

Example :

MySQL COUNT : Use the MySQL COUNT function to count the number rows in a table.
Example :

MySQL SUM : Use the MySQL SUM function to calculate the sum of a set of values or an expression.
Example :

MySQL MIN Function : Use the MySQL MIN function to find the minimum value in a set of values.
Example :

MySQL MAX Function : Use the MySQL MAX function to get the maximum value in a set of values.
Example :

MySQL GROUP_CONCAT : Use the MySQL GROUP_CONCAT function to concatenate strings from a group of values with various options.
Example :

MySQL string functions

SQL Concatenate Functions in MySQL : Combines two or more strings into one string.
Example :

MySQL String Length : Get the length of strings in bytes and in characters.
Example :

MySQL Replace : searches and replaces a substring in a string.
Example :

MySQL Substring : Eextracts a substring starting from a position with a specific length.
Example :

MySQL control flow functions

MySQL IF Function : Returns a value based on a given condition.
Example :

MySQL IFNULL : Returns the first argument if it is not NULL, otherwise returns the second argument.
Example :

MySQL NULLIF : Returns NULL if the first argument is equal to the second argument, otherwise returns the first argument.
Example :

MySQL date and time functions

MySQL DATEDIFF : Calculates the number of days between two DATE or DATETIME values.
Example :

MySQL DATE_FORMAT : Formats a date value based on a specified date format.
Example :

MySQL STR_TO_DATE() : Converts a string into a date and time value based on a specified format.
Example :

MySQL NOW() : Returns the current date and time at which the statement executed.
Example :

Other MySQL functions

MySQL LAST_INSERT_ID : Obtains the last generated sequence number of the last inserted record.
Example :

MySQL CAST() : Converts a value of any type into a value with a specified type.
Example :

Did you enjoy this post? Get John freewebmentor Dot Com updates via email…

If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected]gmail.com. Your article will appear on the FreeWebMentor main page and help other developers.

Recommended Posts:


Prem Tiwari

An engineer by profession and a passionate blogger by heart. Founder of FreeWebMentor.com (A Programming blog for beginners), Tech Speaker at various forums. A part from this he is an open source enthusiast, WordPress Lover, Blogger, SEO, and Growth Strategic.

Article Tags: ,