Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to get good performance to check a string can be translate date type?

user640717Jul 4 2014 — edited Jul 7 2014

Dears

My oracle version is 11.2.0.3

I have a column like below:

201401

201400

201412

I want to change to :

201401 -> 20140101

201400 -> 10140101

201412 -> 20141201

I try this way:

substr(col,5,2) = '00' then

to_date(substr(col,1,4)||'0101'),'yyyymmdd')

else

to_date(col||'01'),'yyyymmdd')

Is any good idea to get better performance?

thx

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 4 2014
Added on Jul 4 2014
4 comments
1,694 views