Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9164

Re: Calculated column using timestamp

$
0
0

Hi Ashutosh,

Use the following to extract year from date.

EXTRACT

 

 

Syntax

 EXTRACT ({YEAR | MONTH | DAY | HOUR | MINUTE | SECOND} FROM d) 

Description

Finds and returns the value of a specified datetime field from date d.

Example

SELECT EXTRACT (YEAR FROM TO_DATE ('2010-01-04', 'YYYY-MM-DD')) "extract" FROM DUMMY; extract 2010

 

 

Regards,

Vijay


Viewing all articles
Browse latest Browse all 9164

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>