Assume we have the following Orders
OrderId: 1
ProductName : OrderDate1
Cheese: 2008-11-11 13:23:44
Now we want to subtract 5 days from the OrderDate date.We use the following SELECT statement:
1 2 3 |
SELECT OrderId,DATE_SUBOrderDate,INTERVAL 5 DAY AS SubtractDateFROM Orders |
Result: 2008-11-06 13:23:44