Connor and Chris will both be at AI World from October 12 to October 17 , the premier Oracle conference of 2025. If you're in Vegas, please come say Hi or pop into our sessions
Thanks for the question, Satish.
Asked: June 30, 2016 - 8:11 am UTC
Last updated: June 30, 2016 - 3:41 pm UTC
Version: 10.1.2
Viewed 1000+ times
create table t ( x varchar2(30) ); insert into t values ('1/1/2014 14:23'); insert into t values ('30/09/2014 12:31:11 PM'); with converted as ( select case when regexp_like(x, '(AM|PM)') then to_timestamp(x, 'dd/mm/yyyy hh:mi:ss am') else to_timestamp(x, 'dd/mm/yyyy hh24:mi') end ts from t ) select extract(year from ts) yr from converted; YR ---------- 2014 2014
Share and learn SQL and PL/SQL; free access to the latest version of Oracle Database!
Classes, workouts and quizzes on Oracle Database technologies. Expertise through exercise!