Files
doris/docs/en/sql-reference/sql-functions/date-time-functions/date_sub.md
ZhangYu0123 1d9b3aeee7 [Doc] Repair document format (#4336)
The error format '##keyword' in a lot of docs. This pr is to repair document format. #4335
2020-08-13 23:39:41 +08:00

1.4 KiB

title, language
title language
date_sub en

date_sub

Description

Syntax

INT DATE_SUB(DATETIME date,INTERVAL expr type)

Subtract the specified time interval from the date

The date parameter is a valid date expression.

The expr parameter is the interval you want to add.

Sweet, sweet, sweet

example

mysql> select date_sub('2010-11-30 23:59:59', INTERVAL 2 DAY);
+-------------------------------------------------+
| date_sub('2010-11-30 23:59:59', INTERVAL 2 DAY) |
+-------------------------------------------------+
| 2010-11-28 23:59:59                             |
+-------------------------------------------------+

keyword

Date, date, date