Difference between revisions of "+(dates)"

From SQLZOO
Jump to: navigation, search
 
(2 intermediate revisions by 2 users not shown)
Line 25: Line 25:
 
SELECT whn, whn+INTERVAL 7 DAY
 
SELECT whn, whn+INTERVAL 7 DAY
 
   FROM eclipse
 
   FROM eclipse
 +
</source>
 +
<source lang='sql' class='def e-oracle'>
 +
SELECT whn, whn+7
 +
  FROM gisq.eclipse
 
</source>
 
</source>
 
<source lang='sql' class='def'>
 
<source lang='sql' class='def'>
Line 31: Line 35:
 
</source>
 
</source>
 
</div>
 
</div>
 +
 +
<p>See also</p>
 
<ul>
 
<ul>
 
   <li>[[EXTRACT |EXTRACT function]]</li>
 
   <li>[[EXTRACT |EXTRACT function]]</li>
 
   <li>[[%2B_INTERVAL |+ INTERVAL function]]</li>
 
   <li>[[%2B_INTERVAL |+ INTERVAL function]]</li>
 
</ul>
 
</ul>
 +
 +
{{Languages}}

Latest revision as of 09:52, 6 September 2012

Compatibility
d + i
EngineOKAlternative
ingresNowhn + date('7 day')
mysqlYes
oracleYes
postgresNod+ INTERVAL 'i DAY'
sqlserverYes

+ (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 gisq.eclipse
SELECT whn, whn+7 
  FROM eclipse

See also

Language: English  • Deutsch
Personal tools
Namespaces

Variants
Actions
Reference
Toolbox
Google AdSense