Date and Time Operations

This section provides a list of date and time operations supported by SQL and some examples.

The most commonly used date and time operations are:


DATE '1999-01-01' + INTERVAL '3' MONTH
DATE '2000-03-01' - INTERVAL '1' DAY -- watch out leap years!
INTERVAL '48' HOUR + TIMESTAMP '1999-01-01 00:00:00'

Last update: 2015.

Table of Contents

 About This Book

 Introduction of SQL

 MySQL Introduction and Installation

 Introduction of MySQL Programs

 Perl Programs and MySQL Servers

 PHP Programs and MySQL Servers

 Java Programs and MySQL Servers

 Datatypes and Data Literals

Operations and Expressions

 What Is Expression

 Arithmetic Operations

 Predicate Operations

Date and Time Operations

 Examples of Different Types of Operation

 Character Strings and Bit Strings

 Commonly Used Functions

 Table Column Types for Different Types of Values

 Using DDL to Create Tables and Indexes

 Using DML to Insert, Update and Delete Records

 Using SELECT to Query Database

 Transaction Management and Isolation Levels

 Locks Used in MySQL

 Defining and Calling Stored Procedures

 Variables, Loops and Cursors Used in Stored Procedures

 Outdated Tutorials


 PDF Printing Version