C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
MySQL Date/Time period_diff() FunctionThe period_diff() is a MySQL date/time function. It is used to get the difference between two given periods. Syntaxselect period_diff(period1, period2); 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 1select period_diff(201908,201808); Output: Example 2select period_diff(201808,199508); Output:
Next TopicMySQL datetime
|