
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
What are the different ways in MySQL to add ‘half year interval’ in date?
We can add ‘half year interval’ in date ith the following ways −
(A) By adding interval of 6 Months
mysql> Select '2017-06-20' + INTERVAL 6 Month AS 'After Half Year Interval'; +--------------------------+ | After Half Year Interval | +--------------------------+ | 2017-12-20 | +--------------------------+ 1 row in set (0.00 sec)
(B) By adding interval of 2 quarters
mysql> Select '2017-06-20' + INTERVAL 2 Quarter AS 'After Half Year Interval'; +--------------------------+ | After Half Year Interval | +--------------------------+ | 2017-12-20 | +--------------------------+ 1 row in set (0.00 sec)
Above query will add half year interval in date with the help of Quarter keyword.
- Related Articles
- What are the several ways to add comments in MySQL query?
- Add a single year to all the date records in a MySQL table column
- Changing year in MySQL date?
- Different Ways to Add Parentheses in C++
- How can it be possible to add 3 months interval in a MySQL date without using the word ‘Months’ with interval?
- How can we add a time interval to date stored in a column of MySQL table?
- Format date in MySQL to return MonthName and Year?
- Ignoring the year in MySQL Query with date range?
- What are the different ways to install pandas?
- What are the different unit values that can be used with MySQL INTERVAL keyword?
- Fetch records from interval of past 3 days from current date in MySQL and add the corresponding records
- How to add a day to the date in MySQL?
- How to add 1 day to the date in MySQL?
- What are the different ways in which water gets contaminated?
- What are the different ways in which air gets polluted?

Advertisements