Tutorial Gateway

  • C
  • C#
  • Java
  • Python
  • SQL
  • MySQL
  • Js
  • BI Tools
    • Informatica
    • Talend
    • Tableau
    • Power BI
    • SSIS
    • SSRS
    • SSAS
    • MDX
    • R Tutorial
    • Alteryx
    • QlikView
  • More
    • C Programs
    • C++ Programs
    • Go Programs
    • Python Programs
    • Java Programs

MySQL PERIOD_ADD Function

by suresh

MySQL PERIOD_ADD function is one of the MySQL Date Functions, which is to add the number of months to a given period. This MySQL Period add function to adds the required months to a given period and returns the output as YYYYMM format. The basic syntax of the PERIOD_ADD() Function in MySQL is as shown below:

PERIOD_ADD(Period, Number_of_Months);

MySQL PERIOD_ADD function Example

This MySQL Period add function accepts either the YYYYMM or YYMM format value as the period argument. The following examples help you understand the use of this MySQL Period_add function. In this MySQL example, we are adding 3, 4, 6 months to the year 2019 and Month 01 and 06.

SELECT PERIOD_ADD(201901, 3);

SELECT PERIOD_ADD(201906, 4);

SELECT PERIOD_ADD(201906, 6);
MySQL PERIOD_ADD Function 1

Let us see another example of the MySQL Period add function. Here, we are using the Period as YYMM format. In this Date Function example in MySQL, 95 means 1995, and 19 means 2019

SELECT PERIOD_ADD(9504, 6);

SELECT PERIOD_ADD(1905, 6);

SELECT PERIOD_ADD(1905, 11);
MySQL PERIOD_ADD Function 2

Placed Under: MySQL

  • How to Download MySQL
  • Install MySQL on Windows
  • MySQL Create Database
  • MySQL Delete Database
  • MySQL Create Table
  • MySQL Drop Table
  • MySQL SELECT Statement
  • MySQL ALIAS Column
  • MySQL Distinct
  • MySQL Insert Statement
  • MySQL Delete
  • MySQL Truncate Table
  • MySQL WHERE Clause
  • MySQL Order By
  • MySQL Group By
  • MySQL Having Clause
  • MySQL LIMIT
  • MySQL Arithmetic Operators
  • MySQL COALESCE Function
  • MySQL AND Operator
  • MySQL NOT Operator
  • MySQL OR Operator
  • MySQL XOR Operator
  • MySQL BETWEEN Operator
  • MySQL Not Between Operator
  • MySQL GREATEST Function
  • MYSQL LEAST Function
  • MySQL LIKE Operator
  • MySQL NOT LIKE Operator
  • MySQL IFNULL Operator
  • MySQL NULLIF Operator
  • MySQL INTERVAL Operator
  • MySQL IS Operator
  • MySQL IN Operator
  • MySQL NOT IN Operator
  • MySQL IS NOT NULL
  • MySQL IS NULL
  • MySQL Inner Join
  • MySQL Cross Join
  • MySQL Right Join
  • MySQL Left Join
  • MySQL Aggregate Functions
  • MySQL Date Functions
  • MySQL Date Function
  • MySQL String Functions
  • MySQL Numeric Functions

Copyright © 2021 · All Rights Reserved by Suresh

About Us | Contact Us | Privacy Policy