Difference between revisions of "+(dates)"
From SQLZOO
(Created page with "<h1>+ INTERVAL</h1> <table align='right' border='1'> <caption>Compatibility</caption> <tr><th colspan='3'>d + i</th></tr> <tr><td align='center'>'''Engine'''</td><td align='ce...") |
|||
| Line 1: | Line 1: | ||
| − | + | ||
<table align='right' border='1'> | <table align='right' border='1'> | ||
<caption>Compatibility</caption> | <caption>Compatibility</caption> | ||
Revision as of 14:32, 16 July 2012
| d + i | ||
|---|---|---|
| Engine | OK | Alternative |
| ingres | No | whn + date('7 day') |
| mysql | Yes | |
| oracle | Yes | |
| postgres | No | d+ INTERVAL 'i DAY' |
| sqlserver | Yes | |
+ (dates)
d + i returns the date i days after the date d.
DATE '2006-05-20' + 7 -> DATE '2006-05-27'
schema:gisq
In this example we show the date 7 days after the value specified in whn
SELECT whn, whn + DATE('7 day') FROM eclipse
SELECT whn, whn+INTERVAL 7 DAY FROM eclipse
SELECT whn, whn+7 FROM eclipse