Javatpoint Logo
Javatpoint Logo

MySQL Date/Time period_diff() Function

The period_diff() is a MySQL date/time function. It is used to get the difference between two given periods.

Syntax

Parameter:

period1 : period value in formate YYMM or YYYYMM.

period2 : period value in formate YYMM or YYYYMM.

Returns:

This function returns the difference in months between two periods.

Example 1

Output:


MySQL Datetime period_diff() Function

Example 2

Output:


MySQL Datetime period_diff() Function
Next TopicMySQL datetime





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA