: DATE_SUB : Date Time Functions MySQL TUTORIALS
Ajax
Ajax Examples
Ajax Tutorials
Scripts and Programs
Javascript
Javascript Examples Tutorials
DHTML Tutorials
Javascript References
Scripts and Programs
HTML
HTML Tutorials
HTML References
HTML DOM 0 References
HTML DOM 2 References
CSS
CSS Tutorials
CSS References
PHP
PHP Source Code
PHP References
Scripts and Programs
C#
C# Source Code
C# Examples
MySQL TUTORIALS
»
Date Time Functions
»
DATE_SUB
»
1
2
222.1 .
Using DATE_SUB function to substract 55 years from current date
Hits: 1183
222.2 .
Getting a date 6 months in the past
Hits: 1111
222.3 .
Selects all rows with a start_date value from within the last 30 days
Hits: 1154
222.4 .
select DATE_SUB(curdate(), INTERVAL '1.1' YEAR_MONTH); (with dot)
Hits: 1132
222.5 .
select DATE_SUB(curdate(), INTERVAL '1-1' YEAR_MONTH);
Hits: 1120
222.6 .
select DATE_SUB(curdate(), INTERVAL 1.1 SECOND_MICROSECOND);
Hits: 1116
222.7 .
select DATE_SUB(curdate(), INTERVAL '1 1' DAY_HOUR);
Hits: 1182
222.8 .
select DATE_SUB(curdate(), INTERVAL '1 1
Hits: 1111
222.9 .
select DATE_SUB(curdate(), INTERVAL '1 1
Hits: 1110
222.10 .
select DATE_SUB(curdate(), INTERVAL 1.1 DAY_MICROSECOND);
Hits: 1171
222.11 .
select DATE_SUB(curdate(), INTERVAL '1
Hits: 1039
222.12 .
select DATE_SUB(curdate(), INTERVAL 1.1 HOUR_MINUTE); (with dot)
Hits: 1156
222.13 .
select DATE_SUB(curdate(), INTERVAL '1
Hits: 1161
222.14 .
select DATE_SUB(curdate(), INTERVAL 1.1 HOUR_SECOND);
Hits: 1215
222.15 .
select DATE_SUB(curdate(), INTERVAL 1.1 HOUR_MICROSECOND);
Hits: 1175
222.16 .
DATE_SUB(curdate(), INTERVAL 1.1 MINUTE_SECOND);
Hits: 1154
222.17 .
DATE_SUB(curdate(), INTERVAL 1.1 MINUTE_MICROSECOND);
Hits: 1085
222.18 .
DATE_SUB(curdate(), INTERVAL 1.1 SECOND);
Hits: 1254
222.19 .
DATE_SUB(curdate(), INTERVAL 1 SECOND);
Hits: 1176
222.20 .
DATE_SUB(curdate(), INTERVAL 1.1 SECOND_MICROSECOND);
Hits: 1140
MySQL TUTORIALS
Date Time Functions
»
DATE_SUB
Introduction
MONTHNAME
ADDDATE
NOW
ADDTIME
PERIOD_ADD
CONVERT_TZ
PERIOD_DIFF
CURDATE
QUARTER
CURRENT_TIMESTAMP
SECOND
CURTIME
SEC_TO_TIME
DATE
SLEEP
DATEDIFF
STR_TO_DATE
DATE_ADD
SUBDATE
DATE_FORMAT
SUBTIME
DATE_SUB
SYSDATE
DAYNAME
TIME
DAYOFMONTH
TIMEDIFF
DAYOFWEEK
TIMESTAMP
DAYOFYEAR
TIMESTAMPADD
EXTRACT
TIMESTAMPDIFF
FROM_DAYS
TIME_FORMAT
FROM_UNIXTIME
TIME_TO_SEC
GET_FORMAT
TO_DAYS
HOUR
UNIX_TIMESTAMP
INTERVAL
UTC_DATE
LAST_DAY
UTC_TIME
LOCALTIME
UTC_TIMESTAMP
LOCALTIMESTAMP
WEEK
MAKEDATE
WEEKDAY
MAKETIME
WEEKOFYEAR
MICROSECOND
YEAR
MINUTE
YEARWEEK
MONTH
Aggregate Functions
Cast Functions Operators
Comparison Functions Operators
Control Flow Functions
Cursor
Data Dictionary
Data Types
Database
Date Time Functions
Encryption Compression Functions
Information Functions
Insert Update Delete
Introduction
Logic Operator
Math Numeric Functions
Miscellaneous Functions
MySQL Utilities
Privilege
Procedure Function
Regular Expressions
Select Query
String Functions
Subquery
Table
Table Join
Trigger
View