Difference between revisions of "SECOND"
From SQLZOO
| Line 45: | Line 45: | ||
<li>[[MONTH |MONTH function]]</li> | <li>[[MONTH |MONTH function]]</li> | ||
</ul> | </ul> | ||
| + | |||
| + | {{Languages}} | ||
Revision as of 22:33, 21 October 2012
| SECOND(d) | ||
|---|---|---|
| Engine | OK | Alternative |
| ingres | Yes | EXTRACT(SECOND from d) |
| mysql | Yes | EXTRACT(SECOND from d) |
| oracle | No | TO_CHAR(d,'HH24') |
| postgres | No | EXTRACT(SECOND from d) |
| sqlserver | Yes | DATEPART(SECOND,d) |
SECOND
SECOND allows you to retrieve the second from a date.
SECOND(d)
In this example you get the second from the date field whn.
SELECT EXTRACT(SECOND FROM whn) AS v ,whn ,wht FROM eclipse
SELECT TO_CHAR(whn,'SECOND') AS v ,whn ,wht FROM gisq.eclipse
SELECT SECOND(whn) AS v, whn, wht FROM eclipse
See also
| Language: | English • Deutsch |
|---|