Difference between revisions of "CURRENT DATE"

From SQLZOO
Jump to: navigation, search
(Created page with "<table align='right' border='1'> <caption>Compatibility</caption> <tr><th colspan='3'>CURRENT_DATE</th></tr> <tr><td align='center'>'''Engine'''</td><td align='center'>'''OK''...")
 
(2 intermediate revisions by one user not shown)
Line 20: Line 20:
 
SELECT CURRENT_TIMESTAMP, whn
 
SELECT CURRENT_TIMESTAMP, whn
 
   FROM eclipse
 
   FROM eclipse
 +
</source>
 +
<source lang='sql' class='def e-oracle'>
 +
SELECT CAST(CURRENT_DATE AS DATE),wk
 +
  FROM gisq.totp
 
</source>
 
</source>
 
<source lang='sql' class='def'>
 
<source lang='sql' class='def'>
Line 30: Line 34:
 
<ul>
 
<ul>
 
   <li>[[CURRENT_TIMESTAMP |CURRENT_TIMESTAMP function]]</li>
 
   <li>[[CURRENT_TIMESTAMP |CURRENT_TIMESTAMP function]]</li>
   <li>[[ +(date) function]]</li>
+
   <li>[[%2B(dates) |+(date) function]]</li>
 
</ul>
 
</ul>

Revision as of 15:45, 16 July 2012

Compatibility
CURRENT_DATE
EngineOKAlternative
ingresYesYou must cast when using DBD::Ingres
mysqlYes
oracleYes
postgresYes
sqlserverNoCONVERT(CHAR(10),CURRENT_TIMESTAMP,126)

CURRENT_DATE

CURRENT_DATE returns today's date.

   CURRENT_DATE -> '2006-12-31'
SELECT CURRENT_TIMESTAMP, whn
  FROM eclipse
SELECT CAST(CURRENT_DATE AS DATE),wk
  FROM gisq.totp
SELECT CAST(CURRENT_DATE AS DATE),wk
  FROM totp

See also

Personal tools
Namespaces

Variants
Actions
Reference
Toolbox
Google AdSense