Jump to: navigation, search

Mysql PERIOD DIFF

From w3cyberlearnings

Contents

MySQL PERIOD_DIFF Function

This function returns the different between two periods. Period format YYYYMM or YYMM.

Syntax PERIOD_DIFF

  • period1: first period.
  • period2: second period.
PERIOD_DIFF(period1, period2);

Example 1

mysql> SELECT PERIOD_DIFF(201204,201202);
+----------------------------+
| PERIOD_DIFF(201204,201202) |
+----------------------------+
|                          2 |
+----------------------------+
1 row in set (0.00 sec)


Related Links



Navigation
Web
SQL
MISC
References